| Conditions | 2 |
| Paths | 1 |
| Total Lines | 9 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | 5 | public static function directSequence($length): Iterator |
|
| 11 | { |
||
| 12 | 5 | $current = 0; |
|
| 13 | return new CallbackIterator(static function () use (& $current, $length) { |
||
| 14 | 5 | if ($current === $length) { |
|
| 15 | 3 | return (new IterateResult())->setAsRunOut(); |
|
| 16 | } |
||
| 17 | |||
| 18 | 5 | return (new IterateResult())->setValue($current++); |
|
| 19 | 5 | }); |
|
| 34 |