1 | <?php |
||
9 | class Address implements ValueObjectInterface |
||
10 | { |
||
11 | /** |
||
12 | * Name of the addressee (natural person or company) |
||
13 | * |
||
14 | * @var String |
||
15 | */ |
||
16 | protected $name; |
||
17 | |||
18 | /** @var Street */ |
||
19 | protected $street; |
||
20 | |||
21 | /** |
||
22 | * District/City area |
||
23 | * |
||
24 | * @var String |
||
25 | */ |
||
26 | protected $district; |
||
27 | |||
28 | /** |
||
29 | * City/Town/Village |
||
30 | * |
||
31 | * @var String |
||
32 | */ |
||
33 | protected $city; |
||
34 | |||
35 | /** |
||
36 | * Region/County/State |
||
37 | * |
||
38 | * @var String |
||
39 | */ |
||
40 | protected $region; |
||
41 | |||
42 | /** |
||
43 | * Postal code/P.O. Box/ZIP code |
||
44 | * |
||
45 | * @var String |
||
46 | */ |
||
47 | protected $postalCode; |
||
48 | |||
49 | /** @var Country */ |
||
50 | protected $country; |
||
51 | |||
52 | /** |
||
53 | * Returns a new Address from native PHP arguments |
||
54 | * |
||
55 | * @param string $name |
||
|
|||
56 | * @param string $street_name |
||
57 | * @param string $street_number |
||
58 | * @param string $district |
||
59 | * @param string $city |
||
60 | * @param string $region |
||
61 | * @param string $postal_code |
||
62 | * @param string $country_code |
||
63 | * |
||
64 | * @return self |
||
65 | * @throws \BadMethodCallException |
||
66 | */ |
||
67 | 2 | public static function fromNative() |
|
85 | |||
86 | /** |
||
87 | * Returns a new Address object |
||
88 | * |
||
89 | * @param String $name |
||
90 | * @param Street $street |
||
91 | * @param String $district |
||
92 | * @param String $city |
||
93 | * @param String $region |
||
94 | * @param String $postalCode |
||
95 | * @param Country $country |
||
96 | */ |
||
97 | 11 | public function __construct(StringLiteral $name, Street $street, StringLiteral $district, StringLiteral $city, StringLiteral $region, StringLiteral $postalCode, Country $country) |
|
107 | |||
108 | /** |
||
109 | * Tells whether two Address are equal |
||
110 | * |
||
111 | * @param ValueObjectInterface $address |
||
112 | * |
||
113 | * @return bool |
||
114 | */ |
||
115 | 2 | public function sameValueAs(ValueObjectInterface $address) |
|
129 | |||
130 | /** |
||
131 | * Returns addressee name |
||
132 | * |
||
133 | * @return String |
||
134 | */ |
||
135 | 4 | public function getName() |
|
139 | |||
140 | /** |
||
141 | * Returns street |
||
142 | * |
||
143 | * @return Street |
||
144 | */ |
||
145 | 4 | public function getStreet() |
|
149 | |||
150 | /** |
||
151 | * Returns district |
||
152 | * |
||
153 | * @return String |
||
154 | */ |
||
155 | 3 | public function getDistrict() |
|
159 | |||
160 | /** |
||
161 | * Returns city |
||
162 | * |
||
163 | * @return String |
||
164 | */ |
||
165 | 4 | public function getCity() |
|
169 | |||
170 | /** |
||
171 | * Returns region |
||
172 | * |
||
173 | * @return String |
||
174 | */ |
||
175 | 4 | public function getRegion() |
|
179 | |||
180 | /** |
||
181 | * Returns postal code |
||
182 | * |
||
183 | * @return String |
||
184 | */ |
||
185 | 4 | public function getPostalCode() |
|
189 | |||
190 | /** |
||
191 | * Returns country |
||
192 | * |
||
193 | * @return Country |
||
194 | */ |
||
195 | 4 | public function getCountry() |
|
199 | |||
200 | /** |
||
201 | * Returns a string representation of the Address in US standard format. |
||
202 | * |
||
203 | * @return string |
||
204 | */ |
||
205 | 1 | public function __toString() |
|
218 | |||
219 | function jsonSerialize() |
||
233 | |||
234 | |||
235 | } |
||
236 |
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.