small code improvement

This commit is contained in:
Susann Sgorzaly
2018-02-28 13:47:38 +01:00
parent fbe5263bca
commit fb9325884d

View File

@@ -64,7 +64,7 @@ trait DatatypeTrait {
$result = []; $result = [];
foreach ($this->titles as $cName) { foreach ($this->titles as $cName) {
$column = array_column($this->data, $cName); $column = array_column($this->data, $cName);
$cDatatypes = array_map('ParseCsv\enums\DatatypeEnum::getValidTypeFromSample', $column); $cDatatypes = array_map(DatatypeEnum::class . '::getValidTypeFromSample', $column);
$result[$cName] = $this->getMostFrequentDatatypeForColumn($cDatatypes); $result[$cName] = $this->getMostFrequentDatatypeForColumn($cDatatypes);
} }
@@ -102,7 +102,7 @@ trait DatatypeTrait {
return false; return false;
} }
$firstRowDatatype = array_map('ParseCsv\enums\DatatypeEnum::getValidTypeFromSample', $firstRow); $firstRowDatatype = array_map(DatatypeEnum::class . '::getValidTypeFromSample', $firstRow);
if ($this->getMostFrequentDatatypeForColumn($firstRowDatatype) !== DatatypeEnum::TYPE_STRING){ if ($this->getMostFrequentDatatypeForColumn($firstRowDatatype) !== DatatypeEnum::TYPE_STRING){
return false; return false;