| Conditions | 5 |
| Paths | 4 |
| Total Lines | 24 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 30 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 25 | protected function compile($expr, Context $context) |
||
| 26 | { |
||
| 27 | if ($expr->class instanceof Node\Name) { |
||
| 28 | $name = $expr->class->parts[0]; |
||
| 29 | |||
| 30 | $arguments = []; |
||
| 31 | |||
| 32 | if (count($expr->args) > 0) { |
||
| 33 | foreach ($expr->args as $argument) { |
||
| 34 | $expression = new Expression($context); |
||
| 35 | $arguments[] = $expression->compile($argument->value); |
||
| 36 | } |
||
| 37 | } else { |
||
| 38 | if (class_exists($name, true)) { |
||
| 39 | return new CompiledExpression(CompiledExpression::OBJECT, new $name()); |
||
| 40 | } |
||
| 41 | } |
||
| 42 | |||
| 43 | return new CompiledExpression(CompiledExpression::OBJECT); |
||
| 44 | } |
||
| 45 | |||
| 46 | $context->debug('Unknown how to pass new'); |
||
| 47 | return new CompiledExpression(); |
||
| 48 | } |
||
| 49 | } |
||
| 50 |