| Conditions | 5 |
| Paths | 5 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 4 |
| CRAP Score | 9.2876 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | 2 | public function iterate(iterable $items, callable $callback): void |
|
| 11 | { |
||
| 12 | 2 | foreach ($items as $key => $item) { |
|
| 13 | 2 | $action = $callback($item, $key, $items); |
|
| 14 | |||
| 15 | 2 | if ($action instanceof LoopAction) { |
|
| 16 | switch ($action->getValue()) { |
||
| 17 | case LoopAction::Break: |
||
| 18 | break 2; |
||
| 19 | |||
| 20 | case LoopAction::Continue: |
||
| 21 | continue 2; |
||
| 22 | } |
||
| 27 |