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