Conditions | 4 |
Paths | 4 |
Total Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
49 | protected function createIterator(): iterable |
||
50 | { |
||
51 | $read = [$this->handle]; |
||
52 | $write = []; |
||
53 | $except = []; |
||
54 | $result = stream_select($read, $write, $except, 0); |
||
55 | |||
56 | if ($result === false) { |
||
57 | throw new Exception('stream_select failed'); |
||
58 | } |
||
59 | if ($result !== 0) { |
||
60 | while (!\feof($this->handle)) { |
||
61 | yield \fgets($this->handle); |
||
62 | } |
||
63 | } |
||
64 | } |
||
65 | } |
||
66 |