File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 13
13
* @author Craig Manley
14
14
* @copyright Copyright © 2010, Craig Manley (www.craigmanley.com)
15
15
* @license http://www.opensource.org/licenses/mit-license.php Licensed under MIT
16
- * @version $Id: CSVReader.php,v 1.17 2014/06/13 22:27:39 cmanley Exp $
16
+ * @version $Id: CSVReader.php,v 1.18 2016/02/15 00:57:54 cmanley Exp $
17
17
* @package cmanley
18
18
*/
19
19
@@ -55,7 +55,7 @@ class CSVReaderException extends Exception {}
55
55
* // Show fieldnames from 1st row:
56
56
* print_r($reader->fieldNames());
57
57
*
58
- * // Iterate over all the rows using foreach. CVSReader behaves as an array.
58
+ * // Iterate over all the rows using foreach. CSVReader behaves as an array.
59
59
* foreach($reader as $row) { // $row is a CSVReaderRow object
60
60
* print 'Price: ' . $row->get('Price') . "\n";
61
61
* print 'Name: ' . $row['Name'] . "\n"; // $row also supports array access
@@ -149,8 +149,11 @@ function __construct($file, array $options = null) {
149
149
$ opt_include_fields = null ;
150
150
if ($ options ) {
151
151
foreach ($ options as $ key => $ value ) {
152
+ if (is_null ($ value )) {
153
+ continue ;
154
+ }
152
155
if (in_array ($ key , array ('debug ' , 'skip_empty_lines ' ))) {
153
- if (!(is_null ( $ value ) || is_bool ($ value ) || is_int ($ value ))) {
156
+ if (!(is_bool ($ value ) || is_int ($ value ))) {
154
157
throw new \InvalidArgumentException ("The ' $ key' option must be a boolean " );
155
158
}
156
159
$ this ->$ key = $ value ;
You can’t perform that action at this time.
0 commit comments