From 539230130d2bf9f548ac0a49a306a08dc0dfec85 Mon Sep 17 00:00:00 2001 From: ignace nyamagana butera Date: Wed, 12 Nov 2014 20:54:22 +0100 Subject: [PATCH] bump version 6.0.1 --- CHANGELOG.md | 8 +++--- src/AbstractCsv.php | 20 +++++++-------- src/Config/Controls.php | 36 +++++++++++++------------- src/Config/StreamFilter.php | 22 ++++++---------- src/Iterator/MapIterator.php | 2 +- src/Iterator/Query.php | 12 ++++----- src/Reader.php | 20 +++++++-------- src/Writer.php | 50 ++++++++++++++++++------------------ 8 files changed, 82 insertions(+), 88 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85e04bda..16346d46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ #Changelog All Notable changes to `League\Csv` will be documented in this file -## NEXT - YYYY-MM-DD +## 6.0.1 - 2014-11-12 ### Added - Nothing @@ -10,15 +10,15 @@ All Notable changes to `League\Csv` will be documented in this file - Nothing ### Fixed -- Nothing +- Bug Fixed `detectDelimiterList` ### Remove - Nothing ### Security -- Bug Fixed `detectDelimiterList` +- Nothing -## 6.0 - 2014-08-28 +## 6.0.0 - 2014-08-28 ### Added - Stream Filter API in `League\Csv\AbstractCsv` diff --git a/src/AbstractCsv.php b/src/AbstractCsv.php index 23acbbc5..566a28ce 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.0 +* @version 6.0.1 * @package League.csv * * For the full copyright and license information, please view the LICENSE @@ -67,7 +67,7 @@ abstract class AbstractCsv implements JsonSerializable, IteratorAggregate protected $encodingFrom = 'UTF-8'; /** - * The constructor + * Create a new instance * * The path must be an SplFileInfo object * an object that implements the `__toString` method @@ -139,9 +139,9 @@ public function __destruct() * @param object|string $path file path * @param string $open_mode the file open mode flag * - * @return static - * * @throws \InvalidArgumentException If $path is a \SplTempFileObject object + * + * @return static */ public static function createFromPath($path, $open_mode = 'r+') { @@ -189,9 +189,9 @@ public static function createFromFileObject(SplFileObject $obj) * * @param string|object $str the string * - * @return static - * * @throws \InvalidArgumentException If the data provided is invalid + * + * @return static */ public static function createFromString($str) { @@ -230,7 +230,7 @@ protected function newInstance($class_name, $open_mode) * * @param string $open_mode the file open mode flag * - * @return \League\Csv\Writer object + * @return \League\Csv\Writer */ public function newWriter($open_mode = 'r+') { @@ -242,7 +242,7 @@ public function newWriter($open_mode = 'r+') * * @param string $open_mode the file open mode flag * - * @return \League\Csv\Reader object + * @return \League\Csv\Reader */ public function newReader($open_mode = 'r+') { @@ -332,9 +332,9 @@ public function output($filename = null) /** * Validate a variable to be stringable * - * @param mixed $str + * @param string $str * - * @return boolean + * @return bool */ public static function isValidString($str) { diff --git a/src/Config/Controls.php b/src/Config/Controls.php index 96ae3025..fb2dd7ef 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.0 +* @version 6.0.1 * @package League.csv * * For the full copyright and license information, please view the LICENSE @@ -50,7 +50,7 @@ trait Controls /** * the \SplFileObject flags holder * - * @var integer + * @var int */ protected $flags = SplFileObject::READ_CSV; @@ -66,9 +66,9 @@ abstract public function getIterator(); * * @param string $delimiter * - * @return $this - * * @throws \InvalidArgumentException If $delimeter is not a single character + * + * @return $this */ public function setDelimiter($delimiter = ',') { @@ -93,10 +93,10 @@ public function getDelimiter() /** * detect the actual number of row according to a delimiter * - * @param string $delimiter a CSV delimiter - * @param integer $nb_rows the number of row to consider + * @param string $delimiter a CSV delimiter + * @param int $nb_rows the number of row to consider * - * @return integer + * @return int */ protected function fetchRowsCountByDelimiter($delimiter, $nb_rows = 1) { @@ -115,12 +115,12 @@ protected function fetchRowsCountByDelimiter($delimiter, $nb_rows = 1) /** * Detect the CSV file delimiter * - * @param integer $nb_rows + * @param int $nb_rows * @param string[] $delimiters additional delimiters * - * @return string[] - * * @throws \InvalidArgumentException If $nb_rows value is invalid + * + * @return string[] */ public function detectDelimiterList($nb_rows = 1, array $delimiters = []) { @@ -149,9 +149,9 @@ public function detectDelimiterList($nb_rows = 1, array $delimiters = []) * * @param string $enclosure * - * @return $this - * * @throws \InvalidArgumentException If $enclosure is not a single character + * + * @return $this */ public function setEnclosure($enclosure = '"') { @@ -178,9 +178,9 @@ public function getEnclosure() * * @param string $escape * - * @return $this - * * @throws \InvalidArgumentException If $escape is not a single character + * + * @return $this */ public function setEscape($escape = "\\") { @@ -205,11 +205,11 @@ public function getEscape() /** * Set the Flags associated to the CSV SplFileObject * - * @param integer $flags - * - * @return $this + * @param int $flags * * @throws \InvalidArgumentException If the argument is not a valid integer + * + * @return $this */ public function setFlags($flags) { @@ -225,7 +225,7 @@ public function setFlags($flags) /** * Returns the file Flags * - * @return integer + * @return int */ public function getFlags() { diff --git a/src/Config/StreamFilter.php b/src/Config/StreamFilter.php index 7e02fcc1..72e88f8d 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.0 +* @version 6.0.1 * @package League.csv * * For the full copyright and license information, please view the LICENSE @@ -36,7 +36,7 @@ trait StreamFilter /** * Stream filtering mode to apply on all filters * - * @var integer + * @var int */ protected $stream_filter_mode = STREAM_FILTER_ALL; @@ -56,8 +56,6 @@ trait StreamFilter * a path to a file * * @param \SplFileObject|string $path The file path - * - * @return void */ protected function initStreamFilter($path) { @@ -75,8 +73,6 @@ protected function initStreamFilter($path) * Extract Available stream settings from $path * * @param string $path the file path - * - * @return void */ protected function extractStreamSettings($path) { @@ -105,8 +101,6 @@ protected function extractStreamSettings($path) /** * Check if the trait methods can be used * - * @return void - * * @throws \LogicException If the API can not be use */ protected function assertStreamable() @@ -119,7 +113,7 @@ protected function assertStreamable() /** * Tells whether the stream filter capabilities can be used * - * @return boolean + * @return bool */ public function isActiveStreamFilter() { @@ -132,11 +126,11 @@ public function isActiveStreamFilter() * Set the new Stream Filter mode and remove all * previously attached stream filters * - * @param integer $mode - * - * @return $this + * @param int $mode * * @throws \OutOfBoundsException If the mode is invalid + * + * @return $this */ public function setStreamFilterMode($mode) { @@ -154,7 +148,7 @@ public function setStreamFilterMode($mode) /** * stream filter mode getter * - * @return integer + * @return int */ public function getStreamFilterMode() { @@ -213,7 +207,7 @@ protected function sanitizeStreamFilter($filter_name) * * @param string $filter_name * - * @return boolean + * @return bool */ public function hasStreamFilter($filter_name) { diff --git a/src/Iterator/MapIterator.php b/src/Iterator/MapIterator.php index 19e89f4c..65b35783 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.0 +* @version 6.0.1 * @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 22544b00..462e6c61 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.0 +* @version 6.0.1 * @package League.csv * * For the full copyright and license information, please view the LICENSE @@ -44,14 +44,14 @@ trait Query /** * iterator Offset * - * @var integer + * @var int */ protected $iterator_offset = 0; /** * iterator maximum length * - * @var integer + * @var int */ protected $iterator_limit = -1; @@ -75,7 +75,7 @@ public function setOffset($offset = 0) /** * Set LimitInterator Count * - * @param integer $limit + * @param int $limit * * @return $this */ @@ -146,7 +146,7 @@ public function removeSortBy(callable $callable) * * @param callable $callable * - * @return boolean + * @return bool */ public function hasSortBy(callable $callable) { @@ -231,7 +231,7 @@ public function removeFilter(callable $callable) * * @param callable $callable * - * @return boolean + * @return bool */ public function hasFilter(callable $callable) { diff --git a/src/Reader.php b/src/Reader.php index 9a0e810a..03221aa7 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.0 +* @version 6.0.1 * @package League.csv * * For the full copyright and license information, please view the LICENSE @@ -68,7 +68,7 @@ public function query(callable $callable = null) * * @param callable $callable The callback function * - * @return integer the iteration count + * @return int the iteration count */ public function each(callable $callable) { @@ -86,11 +86,11 @@ public function each(callable $callable) /** * Return a single row from the CSV * - * @param integer $offset - * - * @return array + * @param int $offset * * @throws \InvalidArgumentException If the $offset is not a valid Integer + * + * @return array */ public function fetchOne($offset = 0) { @@ -129,9 +129,9 @@ public function fetchAll(callable $callable = null) * @param array $keys the name for each key member * @param callable $callable a callable function * - * @return array - * * @throws \InvalidArgumentException If the submitted keys are not integer or strng + * + * @return array */ public function fetchAssoc(array $keys, callable $callable = null) { @@ -182,12 +182,12 @@ protected static function combineArray(array $keys, array $value) * * The callable function will be applied to each value to be return * - * @param integer $column_index field Index + * @param int $column_index field Index * @param callable $callable a callable function * - * @return array - * * @throws \InvalidArgumentException If the column index is not a positive integer or 0 + * + * @return array */ public function fetchColumn($column_index = 0, callable $callable = null) { diff --git a/src/Writer.php b/src/Writer.php index 7958e41e..762c6ac1 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.0 +* @version 6.0.1 * @package League.csv * * For the full copyright and license information, please view the LICENSE @@ -45,21 +45,21 @@ class Writer extends AbstractCsv /** * the object current null handling mode * - * @var integer + * @var int */ protected $null_handling_mode = self::NULL_AS_EXCEPTION; /** * The number of column per row * - * @var integer + * @var int */ protected $columns_count = -1; /** * should the class detect the column count based the inserted row * - * @var boolean + * @var bool */ protected $detect_columns_count = false; @@ -78,11 +78,11 @@ class Writer extends AbstractCsv /** * Tell the class how to handle null value * - * @param integer $value a Writer null behavior constant - *vi - * @return self + * @param int $value a Writer null behavior constant * - * @throws OutOfBoundsException If the Integer is not valid + * @throws \OutOfBoundsException If the Integer is not valid + * + * @return static */ public function setNullHandlingMode($value) { @@ -97,7 +97,7 @@ public function setNullHandlingMode($value) /** * null handling getter * - * @return integer + * @return int */ public function getNullHandlingMode() { @@ -107,11 +107,11 @@ public function getNullHandlingMode() /** * Set Inserted row column count * - * @param integer $value - * - * @return self + * @param int $value * * @throws \InvalidArgumentException If $value is lesser than -1 + * + * @return static */ public function setColumnsCount($value) { @@ -127,7 +127,7 @@ public function setColumnsCount($value) /** * Column count getter * - * @return integer + * @return int */ public function getColumnsCount() { @@ -139,7 +139,7 @@ public function getColumnsCount() * and therefore will also validate the next line whatever length it has no matter * the current $columns_count property value. * - * @return self + * @return static */ public function autodetectColumnsCount() { @@ -155,9 +155,9 @@ public function autodetectColumnsCount() * * @param \Traversable|array $rows a multidimentional array or a Traversable object * - * @return self - * * @throws \InvalidArgumentException If the given rows format is invalid + * + * @return static */ public function insertAll($rows) { @@ -179,9 +179,9 @@ public function insertAll($rows) * * @param string[]|string $data a string, an array or an object implementing to '__toString' method * - * @return self - * * @throws \InvalidArgumentException If the given row is invalid + * + * @return static */ public function insertOne($data) { @@ -203,9 +203,9 @@ public function insertOne($data) * * @param string[]|string $row * - * @return array + * @throws \InvalidArgumentException If the given $row is not valid * - * @throws InvalidArgumentException If the given $row is not valid + * @return array */ protected function validateRow($row) { @@ -230,9 +230,9 @@ protected function validateRow($row) * The value MUST respect the null handling mode * The valie MUST be convertible into a string * - * @param mixed $value the value to be added + * @param string|null $value the value to be added * - * @return boolean + * @return bool */ protected function isConvertibleContent($value) { @@ -265,7 +265,7 @@ protected function sanitizeColumnsContent(array $row) * * @param array $row the row to be added to the CSV * - * @return boolean + * @return bool */ protected function isColumnsCountConsistent(array $row) { @@ -286,7 +286,7 @@ protected function isColumnsCountConsistent(array $row) * insure we use the same object for insertion to * avoid loosing the cursor position * - * @return SplFileObject + * @return \SplFileObject */ protected function getCsv() { @@ -301,7 +301,7 @@ protected function getCsv() /** * Tells whether the stream filter capabilities can be used * - * @return boolean + * @return bool */ public function isActiveStreamFilter() {