| Conditions | 6 |
| Paths | 7 |
| Total Lines | 22 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 14 |
| CRAP Score | 6 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 23 | 5 | protected function compile($expr, Context $context) |
|
| 24 | { |
||
| 25 | 5 | if ($expr->expr instanceof Variable) { |
|
| 26 | 5 | $varName = $expr->expr->name; |
|
| 27 | |||
| 28 | 5 | if ($varName instanceof Name) { |
|
| 29 | 5 | $varName = $varName->parts[0]; |
|
| 30 | 5 | } |
|
| 31 | |||
| 32 | 5 | $variable = $context->getSymbol($varName); |
|
| 33 | |||
| 34 | 5 | if ($variable) { |
|
| 35 | 4 | $variable->incUse(); |
|
| 36 | |||
| 37 | 4 | if ($variable->getValue() !== null && $variable->getValue() != false) { |
|
| 38 | 1 | return CompiledExpression::fromZvalValue(true); |
|
| 39 | } |
||
| 40 | 3 | } |
|
| 41 | 4 | } |
|
| 42 | |||
| 43 | 4 | return CompiledExpression::fromZvalValue(false); |
|
| 44 | } |
||
| 45 | } |
||
| 46 |