@@ -81,8 +81,6 @@ class CsvReader implements CountableReader, \SeekableIterator
8181 */
8282 public function __construct (\SplFileObject $ file , $ delimiter = ', ' , $ enclosure = '" ' , $ escape = '\\' )
8383 {
84- ini_set ('auto_detect_line_endings ' , true );
85-
8684 $ this ->file = $ file ;
8785 $ this ->file ->setFlags (
8886 \SplFileObject::READ_CSV |
@@ -101,10 +99,8 @@ public function __construct(\SplFileObject $file, $delimiter = ',', $enclosure =
10199 * Return the current row as an array
102100 *
103101 * If a header row has been set, an associative array will be returned
104- *
105- * @return array
106102 */
107- public function current ()
103+ public function current (): ? array
108104 {
109105 // If the CSV has no column headers just return the line
110106 if (empty ($ this ->columnHeaders )) {
@@ -196,18 +192,15 @@ public function setHeaderRowNumber($rowNumber, $duplicates = null)
196192 * row. That way, when you iterate over the rows, that header row is
197193 * skipped.
198194 */
199- public function rewind ()
195+ public function rewind (): void
200196 {
201197 $ this ->file ->rewind ();
202198 if (null !== $ this ->headerRowNumber ) {
203199 $ this ->file ->seek ($ this ->headerRowNumber + 1 );
204200 }
205201 }
206202
207- /**
208- * {@inheritdoc}
209- */
210- public function count ()
203+ public function count (): int
211204 {
212205 if (null === $ this ->count ) {
213206 $ position = $ this ->key ();
@@ -220,34 +213,22 @@ public function count()
220213 return $ this ->count ;
221214 }
222215
223- /**
224- * {@inheritdoc}
225- */
226- public function next ()
216+ public function next (): void
227217 {
228218 $ this ->file ->next ();
229219 }
230220
231- /**
232- * {@inheritdoc}
233- */
234- public function valid ()
221+ public function valid (): bool
235222 {
236223 return $ this ->file ->valid ();
237224 }
238225
239- /**
240- * {@inheritdoc}
241- */
242- public function key ()
226+ public function key (): int
243227 {
244228 return $ this ->file ->key ();
245229 }
246230
247- /**
248- * {@inheritdoc}
249- */
250- public function seek ($ pointer )
231+ public function seek ($ pointer ): void
251232 {
252233 $ this ->file ->seek ($ pointer );
253234 }
0 commit comments