| 1 | <?php |
||
| 5 | class TextFileIterator extends GenericIterator |
||
| 6 | { |
||
| 7 | |||
| 8 | protected $fields; |
||
| 9 | protected $fieldexpression; |
||
| 10 | protected $handle; |
||
| 11 | protected $current = 0; |
||
| 12 | protected $currentBuffer = ""; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @access public |
||
| 16 | * @param resource $handle |
||
| 17 | * @param array $fields |
||
| 18 | * @param string $fieldexpression |
||
| 19 | */ |
||
| 20 | 12 | public function __construct($handle, $fields, $fieldexpression) |
|
| 28 | |||
| 29 | 12 | protected function readNextLine() |
|
| 45 | |||
| 46 | /** |
||
| 47 | * @access public |
||
| 48 | * @return int |
||
| 49 | */ |
||
| 50 | 4 | public function count() |
|
| 54 | |||
| 55 | /** |
||
| 56 | * @access public |
||
| 57 | * @return bool |
||
| 58 | */ |
||
| 59 | 12 | public function hasNext() |
|
| 77 | |||
| 78 | /** |
||
| 79 | * @access public |
||
| 80 | * @return Row |
||
| 81 | */ |
||
| 82 | 12 | public function moveNext() |
|
| 108 | |||
| 109 | public function key() |
||
| 113 | } |
||
| 114 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.