Restored some PHP 7.4 support
This commit is contained in:
@ -116,11 +116,21 @@ class Dataset
|
||||
return $reader;
|
||||
}
|
||||
$ext = pathinfo($filename, PATHINFO_EXTENSION);
|
||||
|
||||
/*
|
||||
return match ($ext) {
|
||||
'json' => JsonReader::class,
|
||||
'csv' => CsvReader::class,
|
||||
default => throw new \RuntimeException("Unable to determine reader for dataset file")
|
||||
};
|
||||
*/
|
||||
|
||||
// PHP7.4 compat: use switch instead of match
|
||||
switch ($ext) {
|
||||
case 'json': return JsonReader::class;
|
||||
case 'csv': return CsvReader::class;
|
||||
default: throw new \RuntimeException("Unable to determine reader for dataset file");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user