summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgnace Nyamagana Butera <nyamsprod@gmail.com>2014-08-21 12:08:11 +0200
committerIgnace Nyamagana Butera <nyamsprod@gmail.com>2014-08-21 12:08:11 +0200
commit9dfd08b2aa2c2243b4c03efcb92867948af69f4a (patch)
tree91408efad3711466e74ae74c681d1c7587420487
parentcc654a197a2cc24f2f46be41f60174a1db769c86 (diff)
downloadcsv-9dfd08b2aa2c2243b4c03efcb92867948af69f4a.zip
csv-9dfd08b2aa2c2243b4c03efcb92867948af69f4a.tar.gz
csv-9dfd08b2aa2c2243b4c03efcb92867948af69f4a.tar.bz2
scrutinizr fixes
-rw-r--r--CHANGELOG.md4
-rw-r--r--src/AbstractCsv.php3
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);