1 | <?php |
||
9 | class Address implements ValueObjectInterface |
||
10 | { |
||
11 | /** |
||
12 | * Name of the addressee (natural person or company) |
||
13 | * @var StringLiteral |
||
14 | */ |
||
15 | protected $name; |
||
16 | |||
17 | /** @var Street */ |
||
18 | protected $street; |
||
19 | |||
20 | /** |
||
21 | * District/City area |
||
22 | * @var StringLiteral |
||
23 | */ |
||
24 | protected $district; |
||
25 | |||
26 | /** |
||
27 | * City/Town/Village |
||
28 | * @var StringLiteral |
||
29 | */ |
||
30 | protected $city; |
||
31 | |||
32 | /** |
||
33 | * Region/County/State |
||
34 | * @var StringLiteral |
||
35 | */ |
||
36 | protected $region; |
||
37 | |||
38 | /** |
||
39 | * Postal code/P.O. Box/ZIP code |
||
40 | * @var StringLiteral |
||
41 | */ |
||
42 | protected $postalCode; |
||
43 | |||
44 | /** @var Country */ |
||
45 | protected $country; |
||
46 | |||
47 | /** |
||
48 | * Returns a new Address from native PHP arguments |
||
49 | * |
||
50 | * @param string $name |
||
|
|||
51 | * @param string $street_name |
||
52 | * @param string $street_number |
||
53 | * @param string $district |
||
54 | * @param string $city |
||
55 | * @param string $region |
||
56 | * @param string $postal_code |
||
57 | * @param string $country_code |
||
58 | * |
||
59 | * @return self |
||
60 | * @throws \BadMethodCallException |
||
61 | */ |
||
62 | 2 | public static function fromNative() |
|
80 | |||
81 | /** |
||
82 | * Returns a new Address object |
||
83 | * |
||
84 | * @param StringLiteral $name |
||
85 | * @param Street $street |
||
86 | * @param StringLiteral $district |
||
87 | * @param StringLiteral $city |
||
88 | * @param StringLiteral $region |
||
89 | * @param StringLiteral $postalCode |
||
90 | * @param Country $country |
||
91 | */ |
||
92 | 11 | public function __construct(StringLiteral $name, Street $street, StringLiteral $district, StringLiteral $city, StringLiteral $region, StringLiteral $postalCode, Country $country) |
|
102 | |||
103 | /** |
||
104 | * Tells whether two Address are equal |
||
105 | * |
||
106 | * @param ValueObjectInterface $address |
||
107 | * |
||
108 | * @return bool |
||
109 | */ |
||
110 | 2 | public function sameValueAs(ValueObjectInterface $address) |
|
124 | |||
125 | /** |
||
126 | * Returns addressee name |
||
127 | * |
||
128 | * @return StringLiteral |
||
129 | */ |
||
130 | 4 | public function getName() |
|
134 | |||
135 | /** |
||
136 | * Returns street |
||
137 | * |
||
138 | * @return Street |
||
139 | */ |
||
140 | 4 | public function getStreet() |
|
144 | |||
145 | /** |
||
146 | * Returns district |
||
147 | * |
||
148 | * @return StringLiteral |
||
149 | */ |
||
150 | 3 | public function getDistrict() |
|
154 | |||
155 | /** |
||
156 | * Returns city |
||
157 | * |
||
158 | * @return StringLiteral |
||
159 | */ |
||
160 | 4 | public function getCity() |
|
164 | |||
165 | /** |
||
166 | * Returns region |
||
167 | * |
||
168 | * @return StringLiteral |
||
169 | */ |
||
170 | 4 | public function getRegion() |
|
174 | |||
175 | /** |
||
176 | * Returns postal code |
||
177 | * |
||
178 | * @return StringLiteral |
||
179 | */ |
||
180 | 4 | public function getPostalCode() |
|
184 | |||
185 | /** |
||
186 | * Returns country |
||
187 | * |
||
188 | * @return Country |
||
189 | */ |
||
190 | 4 | public function getCountry() |
|
194 | |||
195 | /** |
||
196 | * Returns a string representation of the Address in US standard format. |
||
197 | * |
||
198 | * @return string |
||
199 | */ |
||
200 | 1 | public function __toString() |
|
213 | |||
214 | function jsonSerialize() |
||
228 | |||
229 | |||
230 | } |
||
231 |
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.