| Conditions | 7 |
| Paths | 6 |
| Total Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 7.2944 |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | 3 | public function applyToNode(Node $node) |
|
| 22 | { |
||
| 23 | 3 | $instruction = $node->getInstruction($this); |
|
| 24 | |||
| 25 | 3 | if (is_array($instruction) || is_object($instruction)) { |
|
| 26 | 3 | $instruction = (object)$instruction; |
|
| 27 | } |
||
| 28 | |||
| 29 | 3 | if (!isset($instruction) || !isset($instruction->input) || !isset($instruction->algo)) { |
|
| 30 | return; |
||
| 31 | } |
||
| 32 | |||
| 33 | 3 | if (!method_exists($this, $instruction->algo)) { |
|
| 34 | return; |
||
| 35 | } |
||
| 36 | |||
| 37 | 3 | $result = call_user_func_array([$this, $instruction->algo], [$instruction->input]); |
|
| 38 | |||
| 39 | 3 | $node->setResult($result); |
|
| 40 | 3 | } |
|
| 41 | |||
| 74 |