Conditions | 5 |
Paths | 5 |
Total Lines | 22 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
32 | public function resolve(ReflectionParameter $parameter, array $arguments, array &$resolved, array &$result): void |
||
33 | { |
||
34 | $name = $parameter->getName(); |
||
35 | if (array_key_exists($name, $resolved)) { |
||
36 | return; |
||
37 | } |
||
38 | |||
39 | if (!$this->container->attributesEnabled()) { |
||
40 | return; |
||
41 | } |
||
42 | |||
43 | $inject = $this->injection->getInjection($parameter); |
||
44 | if ($inject === null) { |
||
45 | return; |
||
46 | } |
||
47 | |||
48 | if (!$this->container->has($inject)) { |
||
49 | throw UnresolvableParameterException::createForFunction($parameter->getDeclaringFunction(), $name); |
||
50 | } |
||
51 | |||
52 | $resolved[$name] = true; |
||
53 | $result[] = $this->container->get($inject); |
||
54 | } |
||
56 |