1 | <?php |
||
23 | abstract class AbstractColumn implements ColumnInterface |
||
24 | { |
||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | protected $name; |
||
29 | |||
30 | /** |
||
31 | * @var string |
||
32 | */ |
||
33 | |||
34 | protected $field; |
||
35 | /** |
||
36 | * @var array |
||
37 | */ |
||
38 | protected $options = []; |
||
39 | |||
40 | /** |
||
41 | * @var TranslatorInterface |
||
42 | */ |
||
43 | protected $translator; |
||
44 | |||
45 | /** |
||
46 | * AbstractColumn constructor. |
||
47 | * @param string $name |
||
48 | * @param string $field |
||
49 | * @param array $options |
||
50 | */ |
||
51 | public function __construct($name, $field, array $options = []) |
||
60 | |||
61 | /** |
||
62 | * @return string |
||
63 | */ |
||
64 | public function getName() |
||
68 | |||
69 | /** |
||
70 | * @return string |
||
71 | */ |
||
72 | public function getField() |
||
76 | |||
77 | /** |
||
78 | * @param mixed $value |
||
79 | * @param mixed $object |
||
80 | * @param mixed $primary |
||
81 | * @param \Twig_Environment $twig |
||
82 | * |
||
83 | * @return mixed |
||
84 | */ |
||
85 | public function render($value, $object, $primary, \Twig_Environment $twig) |
||
102 | |||
103 | /** |
||
104 | * @param \Twig_Environment $twig |
||
105 | * @param string $template |
||
106 | * @param array $options |
||
107 | * |
||
108 | * @return string |
||
109 | */ |
||
110 | protected function renderTemplate(\Twig_Environment $twig, $template, $options) |
||
116 | |||
117 | /** |
||
118 | * set defaults options |
||
119 | * @param OptionsResolver $resolver |
||
120 | */ |
||
121 | public function configureOptions(OptionsResolver $resolver) |
||
157 | |||
158 | /** |
||
159 | * render options as data-* string |
||
160 | * @return string |
||
161 | */ |
||
162 | public function renderOptions() |
||
203 | |||
204 | /** |
||
205 | * @param mixed $object |
||
206 | * @param string $field |
||
207 | * @param string $primary |
||
208 | * @param PropertyAccessor $accessor |
||
209 | * |
||
210 | * @return mixed |
||
211 | */ |
||
212 | public function getValue($object, $field, $primary, $accessor) |
||
243 | |||
244 | /** |
||
245 | * @param string $name |
||
246 | * @return bool |
||
247 | */ |
||
248 | public function hasOption($name) |
||
252 | |||
253 | /** |
||
254 | * @param string $name |
||
255 | * @param string|null $default |
||
256 | * @return misc |
||
257 | */ |
||
258 | public function getOption($name, $default = null) |
||
262 | |||
263 | /** |
||
264 | * @return array |
||
265 | */ |
||
266 | public function getOptions() |
||
270 | |||
271 | /** |
||
272 | * @return TranslatorInterface |
||
273 | */ |
||
274 | public function getTranslator() |
||
278 | |||
279 | /** |
||
280 | * @param TranslatorInterface $translator |
||
281 | */ |
||
282 | public function setTranslator(TranslatorInterface $translator) |
||
286 | |||
287 | |||
288 | } |
||
289 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.
In this case you can add the
@ignore
PhpDoc annotation to the duplicate definition and it will be ignored.