Conditions | 4 |
Paths | 8 |
Total Lines | 20 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
23 | public function warm(View $viewToWarm, View $contextualView = null) |
||
24 | { |
||
25 | $widgetMaps = []; |
||
26 | |||
27 | if (null === $contextualView) { |
||
28 | $contextualView = $viewToWarm; |
||
29 | } |
||
30 | |||
31 | foreach ($viewToWarm->getWidgetMaps() as $_widgetMap) { |
||
32 | $_widgetMap->setContextualView($contextualView); |
||
33 | $widgetMaps[] = $_widgetMap; |
||
34 | } |
||
35 | |||
36 | if ($template = $viewToWarm->getTemplate()) { |
||
37 | $templateWidgetMaps = $this->warm($template, $contextualView); |
||
|
|||
38 | $widgetMaps = array_merge($widgetMaps, $templateWidgetMaps); |
||
39 | } |
||
40 | |||
41 | return $widgetMaps; |
||
42 | } |
||
43 | } |
||
44 |
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: