1 | <?php |
||
10 | class Message |
||
11 | { |
||
12 | /** |
||
13 | * @var string |
||
14 | * |
||
15 | * The domain the message belongs to |
||
16 | */ |
||
17 | private $domain; |
||
18 | |||
19 | /** |
||
20 | * @var string |
||
21 | * |
||
22 | * The key/phrase you write in the source code |
||
23 | */ |
||
24 | private $id; |
||
25 | |||
26 | /** |
||
27 | * @var string |
||
28 | * |
||
29 | * The locale the translations is on |
||
30 | */ |
||
31 | private $locale; |
||
32 | |||
33 | /** |
||
34 | * @var string |
||
35 | * |
||
36 | * The translated string. This is the preview of the message. Ie no placeholders is visible. |
||
37 | */ |
||
38 | private $translation; |
||
39 | |||
40 | /** |
||
41 | * Key value array with metadata. |
||
42 | * |
||
43 | * @var array |
||
44 | */ |
||
45 | private $meta = []; |
||
46 | |||
47 | /** |
||
48 | * @param string $domain |
||
49 | * @param string $id |
||
50 | * @param string $locale |
||
51 | * @param string $translation |
||
52 | * @param array $meta |
||
53 | */ |
||
54 | public function __construct($domain = '', $id = '', $locale = '', $translation = '', array $meta = []) |
||
62 | |||
63 | /** |
||
64 | * @return string |
||
65 | */ |
||
66 | public function getDomain() |
||
70 | |||
71 | /** |
||
72 | * @param string $domain |
||
73 | * |
||
74 | * @return Message |
||
75 | */ |
||
76 | public function setDomain($domain) |
||
82 | |||
83 | /** |
||
84 | * @return string |
||
85 | */ |
||
86 | public function getId() |
||
90 | |||
91 | /** |
||
92 | * @param string $id |
||
93 | * |
||
94 | * @return Message |
||
95 | */ |
||
96 | public function setId($id) |
||
102 | |||
103 | /** |
||
104 | * @return string |
||
105 | */ |
||
106 | public function getLocale() |
||
110 | |||
111 | /** |
||
112 | * @param string $locale |
||
113 | * |
||
114 | * @return Message |
||
115 | */ |
||
116 | public function setLocale($locale) |
||
122 | |||
123 | /** |
||
124 | * @return string |
||
125 | */ |
||
126 | public function getTranslation() |
||
130 | |||
131 | /** |
||
132 | * @param string $translation |
||
133 | * |
||
134 | * @return Message |
||
135 | */ |
||
136 | public function setTranslation($translation) |
||
142 | |||
143 | /** |
||
144 | * @return array |
||
145 | */ |
||
146 | public function getAllMeta() |
||
150 | |||
151 | /** |
||
152 | * @param array $meta |
||
153 | * |
||
154 | * @return Message |
||
155 | */ |
||
156 | public function setMeta(array $meta) |
||
162 | |||
163 | /** |
||
164 | * @param array $meta |
||
|
|||
165 | * |
||
166 | * @return Message |
||
167 | */ |
||
168 | public function addMeta($key, $value) |
||
174 | |||
175 | /** |
||
176 | * @param string $key |
||
177 | * |
||
178 | * @return mixed|null |
||
179 | */ |
||
180 | public function getMeta($key) |
||
188 | } |
||
189 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.