Skip to content

Commit 3e99d5f

Browse files
committed
Fix 2nd parameter type in all print_r and var_export calls (replace 1 with true)
1 parent 1bd620e commit 3e99d5f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

CSVReader.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* @author Craig Manley
1414
* @copyright Copyright © 2010, Craig Manley (www.craigmanley.com)
1515
* @license http://www.opensource.org/licenses/mit-license.php Licensed under MIT
16-
* @version $Id: CSVReader.php,v 1.23 2024/02/18 00:17:41 cmanley Exp $
16+
* @version $Id: CSVReader.php,v 1.24 2024/02/26 14:35:50 cmanley Exp $
1717
* @package cmanley
1818
*/
1919

@@ -167,7 +167,7 @@ function __construct($file, array $options = null) {
167167
}
168168
$this->debug && error_log(__METHOD__ . ' Internal encoding: ' . $this->internal_encoding);
169169
$this->debug && error_log(__METHOD__ . ' File: ' . (is_string($file) ? $file : gettype($file)));
170-
$this->debug && error_log(__METHOD__ . ' Stream is seekable: ' . var_export($this->seekable,1));
170+
$this->debug && error_log(__METHOD__ . ' Stream is seekable: ' . var_export($this->seekable, true));
171171

172172
# Read the BOM, if any.
173173
if (1) {
@@ -362,12 +362,12 @@ function __construct($file, array $options = null) {
362362
$this->must_transcode = false;
363363
}
364364
}
365-
$this->debug && error_log(__METHOD__ . ' Must transcode: ' . var_export($this->must_transcode, 1));
365+
$this->debug && error_log(__METHOD__ . ' Must transcode: ' . var_export($this->must_transcode, true));
366366

367367
# Read header row.
368368
#@trigger_error('');
369369
if ($row = $this->_fgetcsv()) {
370-
$this->debug && error_log(__METHOD__ . ' Raw header row: ' . print_r($row,1));
370+
$this->debug && error_log(__METHOD__ . ' Raw header row: ' . print_r($row, true));
371371
$unknown_fieldinfo = []; # field name => col index pairs
372372

373373
# Get the fieldname => column indices
@@ -402,7 +402,7 @@ function __construct($file, array $options = null) {
402402
}
403403
$this->field_cols[$name] = $x;
404404
}
405-
$this->debug && error_log(__METHOD__ . ' Field name => column index pairs: ' . print_r($this->field_cols,1));
405+
$this->debug && error_log(__METHOD__ . ' Field name => column index pairs: ' . print_r($this->field_cols, true));
406406
}
407407

408408
# Check that all the required header fields are present.

t/t.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function testCreate() {
8484
'ISO 639 English name of language',
8585
'ISO 639 French name of language',
8686
];
87-
$this->assertEquals(var_export($expected_field_names,1), var_export($reader->fieldNames(),1), 'fieldNames()');
87+
$this->assertEquals(var_export($expected_field_names,1), var_export($reader->fieldNames(), true), 'fieldNames()');
8888
#foreach($reader as $row) { // $row is an associative array
8989
# print $row['ISO 639-2 alpha-3'] . "\t" . $row['ISO 639 French name of language'] . "\n";
9090
# print_r($row);

0 commit comments

Comments
 (0)