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