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 | * |
||
33 | * @return Street |
||
34 | * @throws \BadFunctionCallException |
||
35 | */ |
||
36 | 2 | public static function fromNative() |
|
56 | |||
57 | /** |
||
58 | * Returns a new Street object |
||
59 | * |
||
60 | * @param StringLiteral $name |
||
61 | * @param StringLiteral $number |
||
62 | */ |
||
63 | 18 | public function __construct(StringLiteral $name, StringLiteral $number, StringLiteral $elements = NULL, StringLiteral $format = NULL) |
|
78 | |||
79 | /** |
||
80 | * Tells whether two Street objects are equal |
||
81 | * |
||
82 | * @param ValueObjectInterface $street |
||
83 | * |
||
84 | * @return bool |
||
85 | */ |
||
86 | 5 | public function sameValueAs(ValueObjectInterface $street) |
|
97 | |||
98 | /** |
||
99 | * Returns street name |
||
100 | * |
||
101 | * @return StringLiteral |
||
102 | */ |
||
103 | 8 | public function getName() |
|
107 | |||
108 | /** |
||
109 | * Returns street number |
||
110 | * |
||
111 | * @return StringLiteral |
||
112 | */ |
||
113 | 8 | public function getNumber() |
|
117 | |||
118 | /** |
||
119 | * Returns street elements |
||
120 | * @return StringLiteral |
||
121 | */ |
||
122 | 8 | public function getElements() |
|
126 | |||
127 | /** |
||
128 | * Returns a string representation of the StringLiteral in the format defined in the constructor |
||
129 | * |
||
130 | * @return string |
||
131 | */ |
||
132 | 2 | public function __toString() |
|
144 | |||
145 | function jsonSerialize() |
||
157 | |||
158 | |||
159 | } |
||
160 |
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.