| Conditions | 4 |
| Paths | 4 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 4.3731 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 51 | 1 | public function getIterator(): Traversable |
|
| 52 | { |
||
| 53 | 1 | if (!is_resource($this->resource)) { |
|
| 54 | throw new RuntimeException('Stream has no resource'); |
||
| 55 | } |
||
| 56 | |||
| 57 | 1 | if (!$this->isReadable()) { |
|
| 58 | throw new RuntimeException('Stream is not readable'); |
||
| 59 | } |
||
| 60 | |||
| 61 | 1 | while (($line = fgets($this->resource)) !== false) { |
|
| 62 | 1 | yield rtrim($line); |
|
| 63 | } |
||
| 66 |