mirror of
https://github.com/parsecsv/parsecsv-for-php.git
synced 2026-02-19 08:36:39 +00:00
Merge remote-tracking branch 'origin/test-helper-for-itexia-master' into delete_this_branch
This commit is contained in:
@@ -37,7 +37,7 @@ trait DatatypeTrait {
|
||||
return 'integer';
|
||||
}
|
||||
|
||||
if (preg_match('/^[+-]?([0-9]*[.])?([0-9]|[.][0-9])+$/', $value)) {
|
||||
if (preg_match('/(^[+-]?$)|(^[+-]?[0-9]+([,.][0-9])?[0-9]*(e[+-]?[0-9]+)?$)/', $value)) {
|
||||
return 'float';
|
||||
}
|
||||
|
||||
@@ -75,12 +75,17 @@ trait DatatypeTrait {
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @uses getDatatypeFromString
|
||||
*
|
||||
* @return array|bool
|
||||
*/
|
||||
public function getDatatypes() {
|
||||
if (empty($this->data)) {
|
||||
$this->data = $this->parse_string();
|
||||
}
|
||||
if (!is_array($this->data)) {
|
||||
throw new \Exception('No data set yet.');
|
||||
}
|
||||
|
||||
$result = [];
|
||||
foreach ($this->titles as $cName) {
|
||||
|
||||
Reference in New Issue
Block a user