| Conditions | 4 |
| Paths | 4 |
| Total Lines | 12 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 4.0218 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 24 | 11 | public function build(AutowireItemInterface $autowireItem): object |
|
| 25 | { |
||
| 26 | 11 | if ($autowireItem instanceof AliasItem) { |
|
| 27 | 6 | return $this->dependencyResolver->resolveId($autowireItem->getAlias()); |
|
| 28 | 6 | } elseif ($autowireItem instanceof CallableItem) { |
|
| 29 | 2 | $args = $this->dependencyResolver->resolveCallableArgs($autowireItem->getCallable()); |
|
| 30 | |||
| 31 | 2 | return \call_user_func_array($autowireItem->getCallable(), $args); |
|
| 32 | 4 | } elseif ($autowireItem instanceof ClassItem) { |
|
| 33 | 4 | return $this->dependencyResolver->resolveId($autowireItem->getClassName()); |
|
| 34 | } else { |
||
| 35 | throw new ContainerException('Unsupported autowire item type.'); |
||
| 36 | } |
||
| 39 |