diff options
author | Ignace Nyamagana Butera <nyamsprod@gmail.com> | 2014-12-01 17:17:14 +0100 |
---|---|---|
committer | Ignace Nyamagana Butera <nyamsprod@gmail.com> | 2014-12-01 17:17:14 +0100 |
commit | a20b9eb98458d3a52d6709c759babd855cb2732a (patch) | |
tree | 4fac27941cf93bf125077a6f288947e2ba26966e /src | |
parent | bcb0fd0dd7a3c8d913f9262f76b6b6665fdc8828 (diff) | |
download | csv-a20b9eb98458d3a52d6709c759babd855cb2732a.zip csv-a20b9eb98458d3a52d6709c759babd855cb2732a.tar.gz csv-a20b9eb98458d3a52d6709c759babd855cb2732a.tar.bz2 |
prepare for 6.1 release
Diffstat (limited to 'src')
-rw-r--r-- | src/AbstractCsv.php | 4 | ||||
-rw-r--r-- | src/Config/Controls.php | 2 | ||||
-rw-r--r-- | src/Config/StreamFilter.php | 2 | ||||
-rw-r--r-- | src/Iterator/MapIterator.php | 2 | ||||
-rw-r--r-- | src/Iterator/Query.php | 2 | ||||
-rw-r--r-- | src/Reader.php | 16 | ||||
-rw-r--r-- | src/Writer.php | 2 |
7 files changed, 13 insertions, 17 deletions
diff --git a/src/AbstractCsv.php b/src/AbstractCsv.php index 566a28c..5c30036 100644 --- a/src/AbstractCsv.php +++ b/src/AbstractCsv.php @@ -4,7 +4,7 @@ * * @license http://opensource.org/licenses/MIT * @link https://github.com/thephpleague/csv/ -* @version 6.0.1 +* @version 6.1.0 * @package League.csv * * For the full copyright and license information, please view the LICENSE @@ -332,7 +332,7 @@ abstract class AbstractCsv implements JsonSerializable, IteratorAggregate /** * Validate a variable to be stringable * - * @param string $str + * @param object|string $str * * @return bool */ diff --git a/src/Config/Controls.php b/src/Config/Controls.php index fb2dd7e..8eba624 100644 --- a/src/Config/Controls.php +++ b/src/Config/Controls.php @@ -4,7 +4,7 @@ * * @license http://opensource.org/licenses/MIT * @link https://github.com/thephpleague/csv/ -* @version 6.0.1 +* @version 6.1.0 * @package League.csv * * For the full copyright and license information, please view the LICENSE diff --git a/src/Config/StreamFilter.php b/src/Config/StreamFilter.php index 72e88f8..bf9bb84 100644 --- a/src/Config/StreamFilter.php +++ b/src/Config/StreamFilter.php @@ -4,7 +4,7 @@ * * @license http://opensource.org/licenses/MIT * @link https://github.com/thephpleague/csv/ -* @version 6.0.1 +* @version 6.1.0 * @package League.csv * * For the full copyright and license information, please view the LICENSE diff --git a/src/Iterator/MapIterator.php b/src/Iterator/MapIterator.php index 65b3578..1a6a82c 100644 --- a/src/Iterator/MapIterator.php +++ b/src/Iterator/MapIterator.php @@ -4,7 +4,7 @@ * * @license http://opensource.org/licenses/MIT * @link https://github.com/thephpleague/csv/ -* @version 6.0.1 +* @version 6.1.0 * @package League.csv * * For the full copyright and license information, please view the LICENSE diff --git a/src/Iterator/Query.php b/src/Iterator/Query.php index 462e6c6..6db93e9 100644 --- a/src/Iterator/Query.php +++ b/src/Iterator/Query.php @@ -4,7 +4,7 @@ * * @license http://opensource.org/licenses/MIT * @link https://github.com/thephpleague/csv/ -* @version 6.0.1 +* @version 6.1.0 * @package League.csv * * For the full copyright and license information, please view the LICENSE diff --git a/src/Reader.php b/src/Reader.php index dddd33b..d7c2478 100644 --- a/src/Reader.php +++ b/src/Reader.php @@ -4,7 +4,7 @@ * * @license http://opensource.org/licenses/MIT * @link https://github.com/thephpleague/csv/ -* @version 6.0.1 +* @version 6.1.0 * @package League.csv * * For the full copyright and license information, please view the LICENSE @@ -99,12 +99,8 @@ class Reader extends AbstractCsv $this->setLimit(1); $iterator = $this->query(); $iterator->rewind(); - $res = $iterator->current(); - if (! is_array($res)) { - return []; - } - return $res; + return (array) $iterator->current(); } /** @@ -131,7 +127,7 @@ class Reader extends AbstractCsv * used as the associated named keys * @param callable $callable a callable function * - * @throws \InvalidArgumentException If the submitted keys are not integer or strng + * @throws \InvalidArgumentException If the submitted keys are not integer or string * * @return array */ @@ -140,12 +136,12 @@ class Reader extends AbstractCsv $keys = $this->formatAssocKeys($keys); if (! $this->isValidAssocKeys($keys)) { throw new InvalidArgumentException( - 'The named keys should be unique strings Or integer' + 'Use a flat non empty array with unique string values' ); } $iterator = $this->query($callable); $iterator = new MapIterator($iterator, function ($row) use ($keys) { - return self::combineArray($keys, $row); + return static::combineArray($keys, $row); }); return iterator_to_array($iterator, false); @@ -175,7 +171,7 @@ class Reader extends AbstractCsv $iterator = new LimitIterator($this->getIterator(), $keys, 1); $iterator->rewind(); - return $iterator->current(); + return (array) $iterator->current(); } /** diff --git a/src/Writer.php b/src/Writer.php index 762c6ac..4370bc7 100644 --- a/src/Writer.php +++ b/src/Writer.php @@ -4,7 +4,7 @@ * * @license http://opensource.org/licenses/MIT * @link https://github.com/thephpleague/csv/ -* @version 6.0.1 +* @version 6.1.0 * @package League.csv * * For the full copyright and license information, please view the LICENSE |