1 | <?php |
||
8 | class EasyHtmlElementExtension extends \Twig_Extension |
||
9 | { |
||
10 | /** @var HtmlElementInterface */ |
||
11 | private $htmlElement; |
||
12 | |||
13 | public function __construct(HtmlElementInterface $htmlElement) |
||
17 | |||
18 | /** |
||
19 | * {@inheritdoc} |
||
20 | */ |
||
21 | public function getFunctions(): array |
||
27 | |||
28 | /** |
||
29 | * Load a html element. |
||
30 | * |
||
31 | * @param string|array $name The element name |
||
32 | * @param array $parameters The element parameters |
||
33 | * @param array $attributes The element attributes |
||
34 | * @param array $children The element children |
||
35 | * |
||
36 | * @return ElementInterface |
||
37 | */ |
||
38 | public function load( |
||
47 | } |
||
48 |
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: