summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorignace nyamagana butera <nyamsprod@gmail.com>2014-05-05 22:51:15 +0200
committerIgnace Nyamagana Butera <nyamsprod@gmail.com>2014-05-06 10:09:33 +0200
commitedb2d9df29cfb3841e8c0b7d1c2aa43491ecaa31 (patch)
tree6d4a671e262b13c37d0dbb375db292de8a9ed6c2 /src
parent8fe98f9def001e21e461a21d66b8f5cfcfbdbd87 (diff)
downloadcsv-edb2d9df29cfb3841e8c0b7d1c2aa43491ecaa31.zip
csv-edb2d9df29cfb3841e8c0b7d1c2aa43491ecaa31.tar.gz
csv-edb2d9df29cfb3841e8c0b7d1c2aa43491ecaa31.tar.bz2
Update Library info header
Diffstat (limited to 'src')
-rw-r--r--src/Iterator/IteratorFilter.php28
-rw-r--r--src/Iterator/IteratorInterval.php27
-rw-r--r--src/Iterator/IteratorSortBy.php28
-rw-r--r--src/Iterator/MapIterator.php28
-rw-r--r--src/Reader.php33
-rw-r--r--src/Stream/StreamFilter.php35
-rw-r--r--src/Writer.php35
7 files changed, 43 insertions, 171 deletions
diff --git a/src/Iterator/IteratorFilter.php b/src/Iterator/IteratorFilter.php
index 00da7b5..888c97c 100644
--- a/src/Iterator/IteratorFilter.php
+++ b/src/Iterator/IteratorFilter.php
@@ -1,34 +1,14 @@
<?php
/**
-* League.csv - A CSV data manipulation library
+* This file is part of the League.csv library
*
-* @author Ignace Nyamagana Butera <nyamsprod@gmail.com>
-* @copyright 2014 Ignace Nyamagana Butera
-* @link https://github.com/thephpleague/csv/
* @license http://opensource.org/licenses/MIT
+* @link https://github.com/thephpleague/csv/
* @version 5.5.0
* @package League.csv
*
-* MIT LICENSE
-*
-* Permission is hereby granted, free of charge, to any person obtaining
-* a copy of this software and associated documentation files (the
-* "Software"), to deal in the Software without restriction, including
-* without limitation the rights to use, copy, modify, merge, publish,
-* distribute, sublicense, and/or sell copies of the Software, and to
-* permit persons to whom the Software is furnished to do so, subject to
-* the following conditions:
-*
-* The above copyright notice and this permission notice shall be
-* included in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+* For the full copyright and license information, please view the LICENSE
+* file that was distributed with this source code.
*/
namespace League\Csv\Iterator;
diff --git a/src/Iterator/IteratorInterval.php b/src/Iterator/IteratorInterval.php
index 678db60..fe3cbb4 100644
--- a/src/Iterator/IteratorInterval.php
+++ b/src/Iterator/IteratorInterval.php
@@ -1,34 +1,13 @@
<?php
/**
-* League.csv - A CSV data manipulation library
+* This file is part of the League.csv library
*
-* @author Ignace Nyamagana Butera <nyamsprod@gmail.com>
-* @copyright 2014 Ignace Nyamagana Butera
-* @link https://github.com/thephpleague/csv/
* @license http://opensource.org/licenses/MIT
* @version 5.5.0
* @package League.csv
*
-* MIT LICENSE
-*
-* Permission is hereby granted, free of charge, to any person obtaining
-* a copy of this software and associated documentation files (the
-* "Software"), to deal in the Software without restriction, including
-* without limitation the rights to use, copy, modify, merge, publish,
-* distribute, sublicense, and/or sell copies of the Software, and to
-* permit persons to whom the Software is furnished to do so, subject to
-* the following conditions:
-*
-* The above copyright notice and this permission notice shall be
-* included in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+* For the full copyright and license information, please view the LICENSE
+* file that was distributed with this source code.
*/
namespace League\Csv\Iterator;
diff --git a/src/Iterator/IteratorSortBy.php b/src/Iterator/IteratorSortBy.php
index aa85b92..9324364 100644
--- a/src/Iterator/IteratorSortBy.php
+++ b/src/Iterator/IteratorSortBy.php
@@ -1,34 +1,14 @@
<?php
/**
-* League.csv - A CSV data manipulation library
+* This file is part of the League.csv library
*
-* @author Ignace Nyamagana Butera <nyamsprod@gmail.com>
-* @copyright 2014 Ignace Nyamagana Butera
-* @link https://github.com/thephpleague/csv/
* @license http://opensource.org/licenses/MIT
+* @link https://github.com/thephpleague/csv/
* @version 5.5.0
* @package League.csv
*
-* MIT LICENSE
-*
-* Permission is hereby granted, free of charge, to any person obtaining
-* a copy of this software and associated documentation files (the
-* "Software"), to deal in the Software without restriction, including
-* without limitation the rights to use, copy, modify, merge, publish,
-* distribute, sublicense, and/or sell copies of the Software, and to
-* permit persons to whom the Software is furnished to do so, subject to
-* the following conditions:
-*
-* The above copyright notice and this permission notice shall be
-* included in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+* For the full copyright and license information, please view the LICENSE
+* file that was distributed with this source code.
*/
namespace League\Csv\Iterator;
diff --git a/src/Iterator/MapIterator.php b/src/Iterator/MapIterator.php
index ef6d343..3239902 100644
--- a/src/Iterator/MapIterator.php
+++ b/src/Iterator/MapIterator.php
@@ -1,34 +1,14 @@
<?php
/**
-* League.csv - A CSV data manipulation library
+* This file is part of the League.csv library
*
-* @author Ignace Nyamagana Butera <nyamsprod@gmail.com>
-* @copyright 2014 Ignace Nyamagana Butera
-* @link https://github.com/thephpleague/csv/
* @license http://opensource.org/licenses/MIT
+* @link https://github.com/thephpleague/csv/
* @version 5.5.0
* @package League.csv
*
-* MIT LICENSE
-*
-* Permission is hereby granted, free of charge, to any person obtaining
-* a copy of this software and associated documentation files (the
-* "Software"), to deal in the Software without restriction, including
-* without limitation the rights to use, copy, modify, merge, publish,
-* distribute, sublicense, and/or sell copies of the Software, and to
-* permit persons to whom the Software is furnished to do so, subject to
-* the following conditions:
-*
-* The above copyright notice and this permission notice shall be
-* included in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+* For the full copyright and license information, please view the LICENSE
+* file that was distributed with this source code.
*/
namespace League\Csv\Iterator;
diff --git a/src/Reader.php b/src/Reader.php
index 648c3e3..f8c733b 100644
--- a/src/Reader.php
+++ b/src/Reader.php
@@ -1,34 +1,14 @@
<?php
/**
-* League.csv - A CSV data manipulation library
+* This file is part of the League.csv library
*
-* @author Ignace Nyamagana Butera <nyamsprod@gmail.com>
-* @copyright 2014 Ignace Nyamagana Butera
-* @link https://github.com/thephpleague/csv/
* @license http://opensource.org/licenses/MIT
+* @link https://github.com/thephpleague/csv/
* @version 5.5.0
* @package League.csv
*
-* MIT LICENSE
-*
-* Permission is hereby granted, free of charge, to any person obtaining
-* a copy of this software and associated documentation files (the
-* "Software"), to deal in the Software without restriction, including
-* without limitation the rights to use, copy, modify, merge, publish,
-* distribute, sublicense, and/or sell copies of the Software, and to
-* permit persons to whom the Software is furnished to do so, subject to
-* the following conditions:
-*
-* The above copyright notice and this permission notice shall be
-* included in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+* For the full copyright and license information, please view the LICENSE
+* file that was distributed with this source code.
*/
namespace League\Csv;
@@ -72,6 +52,9 @@ class Reader extends AbstractCsv
/**
* Intelligent Array Combine
*
+ * add or remove values from the $value array to
+ * match array $keys length before using PHP array_combine function
+ *
* @param array $keys
* @param array $value
*
@@ -95,7 +78,7 @@ class Reader extends AbstractCsv
*
* @param callable $callable a callable function to be applied to each Iterator item
*
- * @return \Iterator
+ * @return \Traversable
*/
public function query(callable $callable = null)
{
diff --git a/src/Stream/StreamFilter.php b/src/Stream/StreamFilter.php
index b8669de..1f2ac6e 100644
--- a/src/Stream/StreamFilter.php
+++ b/src/Stream/StreamFilter.php
@@ -1,34 +1,14 @@
<?php
/**
-* League.csv - A CSV data manipulation library
+* This file is part of the League.csv library
*
-* @author Ignace Nyamagana Butera <nyamsprod@gmail.com>
-* @copyright 2014 Ignace Nyamagana Butera
-* @link https://github.com/thephpleague/csv/
* @license http://opensource.org/licenses/MIT
+* @link https://github.com/thephpleague/csv/
* @version 5.5.0
* @package League.csv
*
-* MIT LICENSE
-*
-* Permission is hereby granted, free of charge, to any person obtaining
-* a copy of this software and associated documentation files (the
-* "Software"), to deal in the Software without restriction, including
-* without limitation the rights to use, copy, modify, merge, publish,
-* distribute, sublicense, and/or sell copies of the Software, and to
-* permit persons to whom the Software is furnished to do so, subject to
-* the following conditions:
-*
-* The above copyright notice and this permission notice shall be
-* included in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+* For the full copyright and license information, please view the LICENSE
+* file that was distributed with this source code.
*/
namespace League\Csv\Stream;
@@ -91,7 +71,8 @@ trait StreamFilter
}
$path = trim($path);
- //if we are submitting a filter meta wrapper we extract and inject the info
+ //if we are submitting a filter meta wrapper
+ //we extract and inject the mode, the filter and the path
if (preg_match(
',^php://filter/(?P<mode>:?read=|write=)?(?P<filters>.*?)/resource=(?P<resource>.*)$,i',
$path,
@@ -119,6 +100,10 @@ trait StreamFilter
/**
* stream filter mode Setter
+ *
+ * Set the new Stream Filter mode and remove all
+ * previously attached stream filters
+ *
* @param integer $mode
*
* @return self
diff --git a/src/Writer.php b/src/Writer.php
index ce1589d..02a2da1 100644
--- a/src/Writer.php
+++ b/src/Writer.php
@@ -1,34 +1,14 @@
<?php
/**
-* League.csv - A CSV data manipulation library
+* This file is part of the League.csv library
*
-* @author Ignace Nyamagana Butera <nyamsprod@gmail.com>
-* @copyright 2014 Ignace Nyamagana Butera
-* @link https://github.com/thephpleague/csv/
* @license http://opensource.org/licenses/MIT
+* @link https://github.com/thephpleague/csv/
* @version 5.5.0
* @package League.csv
*
-* MIT LICENSE
-*
-* Permission is hereby granted, free of charge, to any person obtaining
-* a copy of this software and associated documentation files (the
-* "Software"), to deal in the Software without restriction, including
-* without limitation the rights to use, copy, modify, merge, publish,
-* distribute, sublicense, and/or sell copies of the Software, and to
-* permit persons to whom the Software is furnished to do so, subject to
-* the following conditions:
-*
-* The above copyright notice and this permission notice shall be
-* included in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+* For the full copyright and license information, please view the LICENSE
+* file that was distributed with this source code.
*/
namespace League\Csv;
@@ -234,7 +214,7 @@ class Writer extends AbstractCsv
*/
private function validateRow($row)
{
- //convert input row into a proper array
+ //convert input string row into a proper array
if (self::isValidString($row)) {
$row = str_getcsv((string) $row, $this->delimiter, $this->enclosure, $this->escape);
}
@@ -245,6 +225,7 @@ class Writer extends AbstractCsv
);
}
+ //validate row according to null handling mode
$check = array_filter($row, function ($value) {
return (is_null($value) && self::NULL_AS_EXCEPTION != $this->null_handling_mode)
|| self::isValidString($value);
@@ -261,6 +242,8 @@ class Writer extends AbstractCsv
/**
* set the csv container as a SplFileObject instance
+ * insure we use the same object for insertion to
+ * avoid loosing the cursor position
*
* @return SplFileObject
*
@@ -308,6 +291,8 @@ class Writer extends AbstractCsv
/**
* Add multiple lines to the CSV your are generating
*
+ * a simple helper/Wrapper method around insertOne
+ *
* @param mixed $rows a multidimentional array or a Traversable object
*
* @return self