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 | * @return self |
||
59 | * @throws \BadMethodCallException |
||
60 | */ |
||
61 | 2 | public static function fromNative() |
|
79 | |||
80 | /** |
||
81 | * Returns a new Address object |
||
82 | * |
||
83 | * @param StringLiteral $name |
||
84 | * @param Street $street |
||
85 | * @param StringLiteral $district |
||
86 | * @param StringLiteral $city |
||
87 | * @param StringLiteral $region |
||
88 | * @param StringLiteral $postalCode |
||
89 | * @param Country $country |
||
90 | */ |
||
91 | 11 | public function __construct(StringLiteral $name, Street $street, StringLiteral $district, StringLiteral $city, StringLiteral $region, StringLiteral $postalCode, Country $country) |
|
101 | |||
102 | /** |
||
103 | * Tells whether two Address are equal |
||
104 | * |
||
105 | * @param ValueObjectInterface $address |
||
106 | * @return bool |
||
107 | */ |
||
108 | 2 | public function sameValueAs(ValueObjectInterface $address) |
|
123 | |||
124 | /** |
||
125 | * Returns addressee name |
||
126 | * |
||
127 | * @return StringLiteral |
||
128 | */ |
||
129 | 4 | public function getName() |
|
133 | |||
134 | /** |
||
135 | * Returns street |
||
136 | * |
||
137 | * @return Street |
||
138 | */ |
||
139 | 4 | public function getStreet() |
|
143 | |||
144 | /** |
||
145 | * Returns district |
||
146 | * |
||
147 | * @return StringLiteral |
||
148 | */ |
||
149 | 3 | public function getDistrict() |
|
153 | |||
154 | /** |
||
155 | * Returns city |
||
156 | * |
||
157 | * @return StringLiteral |
||
158 | */ |
||
159 | 4 | public function getCity() |
|
163 | |||
164 | /** |
||
165 | * Returns region |
||
166 | * |
||
167 | * @return StringLiteral |
||
168 | */ |
||
169 | 4 | public function getRegion() |
|
173 | |||
174 | /** |
||
175 | * Returns postal code |
||
176 | * |
||
177 | * @return StringLiteral |
||
178 | */ |
||
179 | 4 | public function getPostalCode() |
|
183 | |||
184 | /** |
||
185 | * Returns country |
||
186 | * |
||
187 | * @return Country |
||
188 | */ |
||
189 | 4 | public function getCountry() |
|
193 | |||
194 | /** |
||
195 | * Returns a string representation of the Address in US standard format. |
||
196 | * |
||
197 | * @return string |
||
198 | */ |
||
199 | 1 | public function __toString() |
|
212 | } |
||
213 |
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.