Conditions | 4 |
Paths | 3 |
Total Lines | 18 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
13 | protected static function addDependencyForCallParameter($container, $parameter, |
||
14 | array &$parameters, &$dependencies) |
||
15 | { |
||
16 | // If the call parameter is a type-hinted object, |
||
17 | // add the dependency from the first parameter |
||
18 | // that matches the type-hint. |
||
19 | if ($parameter->getClass()) { |
||
20 | foreach ($parameters as $key => $value) { |
||
21 | if ($parameter->getClass()->isInstance($value)) { |
||
22 | $dependencies[] = $value; |
||
23 | unset($parameters[$key]); |
||
24 | return; |
||
25 | } |
||
26 | } |
||
27 | } |
||
28 | |||
29 | parent::addDependencyForCallParameter($container, $parameter, $parameters, $dependencies); |
||
30 | } |
||
31 | } |
||
32 |