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 | 3 | public function iterate(iterable $items, callable $callback): void |
|
11 | { |
||
12 | 3 | foreach ($items as $key => $item) { |
|
13 | 3 | $action = $callback($item, $key, $items); |
|
14 | |||
15 | 3 | 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 |