diff --git a/src/CsvReader.php b/src/CsvReader.php index c50871f..b209157 100644 --- a/src/CsvReader.php +++ b/src/CsvReader.php @@ -112,7 +112,7 @@ public function current() } // Since the CSV has column headers use them to construct an associative array for the columns in this line - do { + while($this->valid()) { $line = $this->file->current(); // In non-strict mode pad/slice the line to match the column headers @@ -139,7 +139,7 @@ public function current() $this->errors[$this->key()] = $line; $this->next(); } - } while($this->valid()); + } return null; }