| Conditions | 6 |
| Paths | 4 |
| Total Lines | 24 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 15 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | 44 | private function newIterator(StreamInterface $stream): \Generator |
|
| 23 | { |
||
| 24 | 44 | $stream->rewind(); |
|
| 25 | |||
| 26 | 44 | $bytes = ''; |
|
| 27 | 44 | while (!$stream->eof()) { |
|
| 28 | 44 | $bytes .= $stream->read(1000); |
|
| 29 | |||
| 30 | 44 | $index = 0; |
|
| 31 | 44 | while (isset($bytes[$index])) { |
|
| 32 | 44 | if ($bytes[$index] === "\r" && isset($bytes[$index + 1]) && $bytes[$index + 1] === "\n") { |
|
| 33 | 23 | $line = \substr($bytes, 0, $index); |
|
| 34 | 23 | $bytes = \substr($bytes, $index + 2); |
|
| 35 | 23 | $index = -1; |
|
| 36 | |||
| 37 | 23 | yield $line; |
|
| 38 | } |
||
| 39 | |||
| 40 | 44 | $index++; |
|
| 41 | } |
||
| 42 | } |
||
| 43 | |||
| 44 | 29 | yield $bytes; |
|
| 45 | 22 | } |
|
| 46 | } |
||
| 47 |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.