diff options
-rw-r--r-- | CHANGELOG.md | 4 | ||||
-rw-r--r-- | src/AbstractCsv.php | 3 |
2 files changed, 2 insertions, 5 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index bed6116..9e6b5c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,11 @@ #Changelog -All Notable changes to League\Csv will be documented in this file +All Notable changes to `League\Csv` will be documented in this file ## NEXT - XXXX-XX-XX ### Added - Stream Filter API in `League\Csv\AbstractCsv` -- named constructors `createFromPath` and createFromFileObject in `League\Csv\AbstractCsv` to ease CSV object instantiation +- named constructors `createFromPath` and `createFromFileObject` in `League\Csv\AbstractCsv` to ease CSV object instantiation - `detectDelimiters` in `League\Csv\AbstractCsv` to replace and remove the use of `Exception` in `detectDelimiter` - `setEncodingFrom` and `setDecodingFrom` in `League\Csv\AbstractCsv` diff --git a/src/AbstractCsv.php b/src/AbstractCsv.php index b4dda17..13eb463 100644 --- a/src/AbstractCsv.php +++ b/src/AbstractCsv.php @@ -282,14 +282,11 @@ abstract class AbstractCsv implements JsonSerializable, IteratorAggregate throw new InvalidArgumentException('`$nb_rows` must be a valid positive integer'); } - //validate the possible delimiters $delimiters = array_filter($delimiters, function ($str) { return 1 == mb_strlen($str); }); $delimiters = array_merge([$this->delimiter, ',', ';', "\t"], $delimiters); $delimiters = array_unique($delimiters); - - //detect the possible delimiter $res = array_fill_keys($delimiters, 0); array_walk($res, function (&$value, $delim) use ($nb_rows) { $value = $this->fetchRowsCountByDelimiter($delim, $nb_rows); |