Conditions | 3 |
Paths | 2 |
Total Lines | 19 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
40 | private function buildDependencies(ReflectionClass $reflection): array |
||
41 | { |
||
42 | if(!$constructor = $reflection->getConstructor()) |
||
43 | { |
||
44 | return []; |
||
45 | } |
||
46 | |||
47 | $params = $constructor->getParameters(); |
||
48 | |||
49 | return array_map(function ($param) |
||
50 | { |
||
51 | if(!$type = $param->getType()) |
||
52 | { |
||
53 | throw new RuntimeException(); |
||
54 | } |
||
55 | |||
56 | return $this->obtener($type->getName()); |
||
57 | |||
58 | }, $params); |
||
59 | } |
||
60 | } |