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