1 | <?php |
||
28 | 1 | class DefaultPhraseAdapter extends Nette\Object implements IPhraseAdapter |
|
29 | { |
||
30 | /** |
||
31 | * @var string |
||
32 | */ |
||
33 | protected $message; |
||
34 | |||
35 | /** |
||
36 | * @var int |
||
37 | */ |
||
38 | protected $count; |
||
39 | |||
40 | /** |
||
41 | * @var array |
||
42 | */ |
||
43 | protected $parameters; |
||
44 | |||
45 | /** |
||
46 | * @param string $message |
||
47 | * @param int $count |
||
48 | * @param array $parameters |
||
49 | */ |
||
50 | public function __construct($message, $count, $parameters = []) |
||
56 | |||
57 | /** |
||
58 | * {@inheritdoc} |
||
59 | */ |
||
60 | public function translate(Localization\ITranslator $translator) |
||
61 | { |
||
62 | 1 | return $translator->translate($this->message, $this->count, $this->parameters); |
|
|
|||
63 | } |
||
64 | |||
65 | /** |
||
66 | * {@inheritdoc} |
||
67 | */ |
||
68 | public function setMessage($message) |
||
72 | |||
73 | /** |
||
74 | * {@inheritdoc} |
||
75 | */ |
||
76 | public function setCount($count) |
||
80 | |||
81 | /** |
||
82 | * {@inheritdoc} |
||
83 | */ |
||
84 | public function setParameters($parameters) |
||
88 | } |
||
89 |
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.