| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | 24 | protected function compile($expr, Context $context) |
|
| 22 | { |
||
| 23 | 24 | $variable = $context->getSymbol($expr->name); |
|
| 24 | 24 | if ($variable) { |
|
| 25 | 23 | $variable->incGets(); |
|
| 26 | 24 | return new CompiledExpression($variable->getType(), $variable->getValue(), $variable); |
|
| 27 | } |
||
| 28 | |||
| 29 | 2 | $context->notice( |
|
| 30 | 2 | 'undefined-variable', |
|
| 31 | 2 | sprintf('You are trying to use an undefined variable $%s', $expr->name), |
|
| 32 | $expr |
||
| 33 | 2 | ); |
|
| 34 | |||
| 35 | 2 | return new CompiledExpression(); |
|
| 36 | } |
||
| 37 | } |
||
| 38 |