getDatatypes: Documented the need for PHP 5.5 or higher

This commit is contained in:
Christian Bläul
2018-02-20 22:16:49 +01:00
parent 4cba97ad51
commit a60aae47a4
2 changed files with 8 additions and 0 deletions

View File

@@ -43,6 +43,8 @@ trait DatatypeTrait {
* Check data type foreach Column * Check data type foreach Column
* Check data type for each column and returns the most commonly. * Check data type for each column and returns the most commonly.
* *
* Requires PHP >= 5.5
*
* @access public * @access public
* *
* @uses getDatatypeFromString * @uses getDatatypeFromString

View File

@@ -137,6 +137,12 @@ class ParseTest extends TestCase
* @depends testSepRowAutoDetection * @depends testSepRowAutoDetection
*/ */
public function testGetColumnDatatypes() { public function testGetColumnDatatypes() {
if (!function_exists('array_column')) {
// getDatatypes requires array_column, but that
// function is only available in PHP >= 5.5
return;
}
$this->csv->auto(__DIR__ . '/fixtures/datatype.csv'); $this->csv->auto(__DIR__ . '/fixtures/datatype.csv');
$this->csv->getDatatypes(); $this->csv->getDatatypes();
$expected = [ $expected = [