| Conditions | 4 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 35 | protected function mapParameterToInjection(ReflectionParameter $reflectionParameter): Injection |
||
| 36 | { |
||
| 37 | $type = $reflectionParameter->getType(); |
||
| 38 | // No type? Let's inject by parameter name. |
||
| 39 | if ($type === null || $type->isBuiltin()) { |
||
| 40 | return new ServiceInjection($reflectionParameter->getName(), !$reflectionParameter->allowsNull()); |
||
| 41 | } |
||
| 42 | if (((string)$type) === ContainerInterface::class) { |
||
| 43 | return new ContainerInjection(); |
||
| 44 | } |
||
| 45 | return new ServiceInjection((string)$type, !$reflectionParameter->allowsNull()); |
||
| 46 | } |
||
| 64 |