| Conditions | 3 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | 149 | public static function pairwise(array $input): \Generator |
|
| 13 | { |
||
| 14 | 149 | foreach ($input as $currentValue) { |
|
| 15 | 148 | if (!isset($prevValue)) { |
|
| 16 | 148 | $prevValue = $currentValue; |
|
| 17 | 148 | continue; |
|
| 18 | } |
||
| 19 | |||
| 20 | 145 | yield [$prevValue, $currentValue]; |
|
| 21 | |||
| 22 | 121 | $prevValue = $currentValue; |
|
| 23 | } |
||
| 26 |