Conditions | 4 |
Paths | 2 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | public function call() |
||
16 | { |
||
17 | $builder = $this->getBuilder(); |
||
18 | |||
19 | $expression = $this->getParam('expression', '1==1'); |
||
20 | $result = $this->getParam('result', true); |
||
21 | |||
22 | $expResult = $this->evalExpression($expression); |
||
23 | |||
24 | if ((is_bool($result) && $result !== (bool) $expResult) || ! preg_match("|{$result}|", $expResult)) { |
||
25 | $builder->down(); |
||
26 | } |
||
27 | |||
28 | return $builder->withData('expected_result', $result) |
||
29 | ->withData('expression_result', $expResult) |
||
30 | ->build(); |
||
31 | } |
||
43 |