1 | <?php |
||
15 | class Formatter implements FormatterInterface |
||
16 | { |
||
17 | /** |
||
18 | * @var Match |
||
19 | */ |
||
20 | protected $match; |
||
21 | |||
22 | public function __construct() |
||
25 | |||
26 | /** |
||
27 | * {@inheritdoc} |
||
28 | * |
||
29 | * @return Match |
||
30 | */ |
||
31 | public function getMatch() |
||
35 | |||
36 | /** |
||
37 | * {@inheritdoc} |
||
38 | * |
||
39 | * @param Match $match |
||
40 | * @return $this |
||
41 | */ |
||
42 | public function setMatch(Match $match) |
||
48 | |||
49 | /** |
||
50 | * {@inheritdoc} |
||
51 | * |
||
52 | * @param TemplateInterface $template |
||
53 | * @return mixed|string |
||
54 | */ |
||
55 | public function getMessage(TemplateInterface $template) |
||
69 | |||
70 | /** |
||
71 | * {@inheritdoc} |
||
72 | * |
||
73 | * @param mixed $obj |
||
74 | * @return string |
||
75 | */ |
||
76 | public function objectToString($obj) |
||
100 | |||
101 | /** |
||
102 | * Applies match results to other template variables. |
||
103 | * |
||
104 | * @param TemplateInterface $template |
||
105 | * @return array |
||
106 | */ |
||
107 | protected function getTemplateVars(TemplateInterface $template) |
||
120 | } |
||
121 |
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: