1 | <?php |
||
24 | final class EditInPlaceTranslator implements TranslatorInterface, TranslatorBagInterface |
||
25 | { |
||
26 | /** |
||
27 | * @var TranslatorInterface|\Symfony\Component\Translation\Translator |
||
28 | */ |
||
29 | private $translator; |
||
30 | |||
31 | /** |
||
32 | * @var ActivatorInterface |
||
33 | */ |
||
34 | private $activator; |
||
35 | |||
36 | /** |
||
37 | * @var RequestStack |
||
38 | */ |
||
39 | private $requestStack; |
||
40 | |||
41 | public function __construct(TranslatorInterface $translator, ActivatorInterface $activator, RequestStack $requestStack) |
||
47 | |||
48 | /** |
||
49 | * @see Translator::getCatalogue |
||
50 | */ |
||
51 | public function getCatalogue($locale = null) |
||
55 | |||
56 | /** |
||
57 | * @see Translator::trans |
||
58 | */ |
||
59 | public function trans($id, array $parameters = [], $domain = null, $locale = null) |
||
78 | |||
79 | /** |
||
80 | * @see Translator::trans |
||
81 | */ |
||
82 | public function transChoice($id, $number, array $parameters = [], $domain = null, $locale = null) |
||
94 | |||
95 | /** |
||
96 | * @see Translator::trans |
||
97 | */ |
||
98 | public function setLocale($locale) |
||
102 | |||
103 | /** |
||
104 | * @see Translator::trans |
||
105 | */ |
||
106 | public function getLocale() |
||
110 | } |
||
111 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: