1 | <?php |
||
16 | class TwigEngine extends AbstractEngine |
||
17 | { |
||
18 | const DEFAULT_CACHE_PATH = '../cache/twig'; |
||
19 | |||
20 | /** |
||
21 | * @var Twig_Environment $twig |
||
22 | */ |
||
23 | private $twig; |
||
24 | |||
25 | /** |
||
26 | * @return string |
||
27 | */ |
||
28 | public function type(): string |
||
32 | |||
33 | /** |
||
34 | * @return Twig_Environment |
||
35 | */ |
||
36 | public function twig(): Twig_Environment |
||
43 | |||
44 | /** |
||
45 | * @param string $templateIdent The template identifier to load and render. |
||
46 | * @param mixed $context The rendering context. |
||
47 | * @return string The rendered template string. |
||
48 | */ |
||
49 | public function render(string $templateIdent, $context): string |
||
54 | |||
55 | /** |
||
56 | * @param string $templateString The template string to render. |
||
57 | * @param mixed $context The rendering context. |
||
58 | * @return string The rendered template string. |
||
59 | */ |
||
60 | public function renderTemplate(string $templateString, $context): string |
||
66 | |||
67 | /** |
||
68 | * @return Twig_Environment |
||
69 | */ |
||
70 | protected function createTwig(): Twig_Environment |
||
80 | |||
81 | /** |
||
82 | * Set the engine's cache implementation. |
||
83 | * |
||
84 | * @param mixed $cache A Twig cache option. |
||
85 | * @return void |
||
86 | */ |
||
87 | protected function setCache($cache): void |
||
99 | } |
||
100 |
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: