| Conditions | 4 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 59 | 12 | public function hasNext() |
|
| 60 | { |
||
| 61 | 12 | if ($this->currentBuffer !== false) { |
|
| 62 | 12 | return true; |
|
| 63 | } |
||
| 64 | |||
| 65 | 12 | if (!$this->handle) { |
|
| 66 | 12 | return false; |
|
| 67 | } |
||
| 68 | |||
| 69 | 12 | if (feof($this->handle)) { |
|
| 70 | 12 | fclose($this->handle); |
|
| 71 | 12 | $this->handle = null; |
|
| 72 | 12 | return false; |
|
| 73 | } |
||
| 74 | |||
| 75 | 3 | return true; |
|
| 76 | } |
||
| 77 | |||
| 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.