Conditions | 7 |
Paths | 6 |
Total Lines | 21 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
17 | public function execute(Board $board, string $alias, array $operation) |
||
18 | { |
||
19 | $iteration = 0; |
||
20 | while(true) { |
||
21 | $left = (string)$board->getVariable($operation['left']); |
||
22 | $board->debug(sprintf('While Evaluate %s %s %s', $left, $operation['operator'], $operation['right'])); |
||
23 | if($operation['operator'] === 'is' && $left === (string)$operation['right']) { |
||
24 | $board->runActorProgram($alias, $operation['program']); |
||
25 | } elseif($operation['operator'] === 'not' && $left !== (string)$operation['right']) { |
||
26 | $board->runActorProgram($alias, $operation['program']); |
||
27 | } else { |
||
28 | $board->debug('While LoopEnd'); |
||
29 | break; |
||
30 | } |
||
31 | if($iteration > $this->iterations) { |
||
32 | $board->debug('Iterations exceeded!'); |
||
33 | break; |
||
34 | } |
||
35 | $iteration++; |
||
36 | } |
||
37 | } |
||
38 | |||
49 |