1 | <?php |
||
9 | class Street implements ValueObjectInterface |
||
10 | { |
||
11 | /** @var StringLiteral */ |
||
12 | protected $name; |
||
13 | |||
14 | /** @var StringLiteral */ |
||
15 | protected $number; |
||
16 | |||
17 | /** @var StringLiteral Building, floor and unit */ |
||
18 | protected $elements; |
||
19 | |||
20 | /** |
||
21 | * @var StringLiteral __toString() format |
||
22 | * Use properties corresponding placeholders: %name%, %number%, %elements% |
||
23 | */ |
||
24 | protected $format; |
||
25 | |||
26 | /** |
||
27 | * Returns a new Street from native PHP string name and number. |
||
28 | * |
||
29 | * @param string $name |
||
|
|||
30 | * @param string $number |
||
31 | * @param string $elements |
||
32 | * @return Street |
||
33 | * @throws \BadFunctionCallException |
||
34 | */ |
||
35 | 2 | public static function fromNative() |
|
55 | |||
56 | /** |
||
57 | * Returns a new Street object |
||
58 | * |
||
59 | * @param StringLiteral $name |
||
60 | * @param StringLiteral $number |
||
61 | */ |
||
62 | 18 | public function __construct(StringLiteral $name, StringLiteral $number, StringLiteral $elements = null, StringLiteral $format = null) |
|
77 | |||
78 | /** |
||
79 | * Tells whether two Street objects are equal |
||
80 | * @param ValueObjectInterface $street |
||
81 | * @return bool |
||
82 | */ |
||
83 | 5 | public function sameValueAs(ValueObjectInterface $street) |
|
94 | |||
95 | /** |
||
96 | * Returns street name |
||
97 | * |
||
98 | * @return StringLiteral |
||
99 | */ |
||
100 | 8 | public function getName() |
|
104 | |||
105 | /** |
||
106 | * Returns street number |
||
107 | * |
||
108 | * @return StringLiteral |
||
109 | */ |
||
110 | 8 | public function getNumber() |
|
114 | |||
115 | /** |
||
116 | * Returns street elements |
||
117 | * @return StringLiteral |
||
118 | */ |
||
119 | 8 | public function getElements() |
|
123 | |||
124 | /** |
||
125 | * Returns a string representation of the StringLiteral in the format defined in the constructor |
||
126 | * |
||
127 | * @return string |
||
128 | */ |
||
129 | 2 | public function __toString() |
|
141 | } |
||
142 |
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.