1 | <?php |
||
26 | class VarTranslator |
||
27 | { |
||
28 | /** |
||
29 | * @var Filter |
||
30 | */ |
||
31 | protected $filter; |
||
32 | |||
33 | /** |
||
34 | * @var Helper |
||
35 | */ |
||
36 | protected $helper; |
||
37 | |||
38 | /** |
||
39 | * @var OnVar |
||
40 | */ |
||
41 | protected $onVar; |
||
42 | |||
43 | /** |
||
44 | * Global translation |
||
45 | * |
||
46 | * @var Translation |
||
47 | */ |
||
48 | protected $translation; |
||
49 | |||
50 | /** |
||
51 | * @param Filter $filter |
||
52 | * @param Helper $helper |
||
53 | * @param OnVar $onVar |
||
54 | */ |
||
55 | public function __construct(Filter $filter, Helper $helper, OnVar $onVar) |
||
61 | |||
62 | /** |
||
63 | * Get global translation |
||
64 | * |
||
65 | * @return Translation |
||
66 | */ |
||
67 | public function getTranslation() |
||
74 | |||
75 | /** |
||
76 | * Set global translation |
||
77 | * |
||
78 | * @param Translation $translation |
||
79 | * @return $this |
||
80 | */ |
||
81 | public function setTranslation(Translation $translation) |
||
86 | |||
87 | /** |
||
88 | * @param Translation $translation |
||
89 | * @param array $spec |
||
90 | * @return $this |
||
91 | */ |
||
92 | public function apply(Translation $translation, array $spec) |
||
122 | |||
123 | /** |
||
124 | * Apply variable logic |
||
125 | * |
||
126 | * @param Translation $varTranslation |
||
127 | * @param array $spec |
||
128 | * @param callable $callback |
||
129 | * @return $this |
||
130 | */ |
||
131 | public function applyOnVar(Translation $varTranslation, array $spec, callable $callback) |
||
136 | |||
137 | /** |
||
138 | * @param array $vars |
||
139 | * @return Translation |
||
140 | */ |
||
141 | public function createTranslation(array $vars) |
||
145 | } |
||
146 |
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: