Merge remote-tracking branch 'origin/test-helper-for-itexia-master' into delete_this_branch

This commit is contained in:
Christian Bläul
2018-02-18 19:41:38 +01:00
4 changed files with 9 additions and 4 deletions

View File

@@ -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) {