Conditions | 5 |
Paths | 9 |
Total Lines | 22 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
31 | private function createSpec(array $config, &$spec= []) |
||
32 | { |
||
33 | foreach ($config as $feature) { |
||
34 | |||
35 | // TODO refactoring dependencies |
||
36 | // if interface |
||
37 | if (method_exists($feature, 'getDependencies')) { |
||
38 | $spec = array_replace($spec, $this->createSpec($feature->getDependencies(), $spec)); |
||
39 | } |
||
40 | |||
41 | if ($feature instanceof SpecConfigAggregateInterface) { |
||
42 | $this->addFeature($feature); |
||
|
|||
43 | $feature = $feature->getSpecConfig(); |
||
44 | } |
||
45 | |||
46 | if ($feature instanceof AbstractSpecConfig) { |
||
47 | $spec[$feature->getName()] = $feature->toArray(); |
||
48 | } |
||
49 | } |
||
50 | |||
51 | return $spec; |
||
52 | } |
||
53 | } |
||
54 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: