1 | <?php |
||
9 | class Name implements ValueObjectInterface |
||
10 | { |
||
11 | /** |
||
12 | * First name |
||
13 | * |
||
14 | * @var \ValueObjects\StringLiteral\StringLiteral |
||
15 | */ |
||
16 | private $firstName; |
||
17 | |||
18 | /** |
||
19 | * Middle name |
||
20 | * |
||
21 | * @var \ValueObjects\StringLiteral\StringLiteral |
||
22 | */ |
||
23 | private $middleName; |
||
24 | |||
25 | /** |
||
26 | * Last name |
||
27 | * |
||
28 | * @var \ValueObjects\StringLiteral\StringLiteral |
||
29 | */ |
||
30 | private $lastName; |
||
31 | |||
32 | /** |
||
33 | * Returns a Name objects form PHP native values |
||
34 | * |
||
35 | * @param string $first_name |
||
|
|||
36 | * @param string $middle_name |
||
37 | * @param string $last_name |
||
38 | * @return Name |
||
39 | */ |
||
40 | 1 | public static function fromNative() |
|
50 | |||
51 | /** |
||
52 | * Returns a Name object |
||
53 | * |
||
54 | * @param StringLiteral $first_name |
||
55 | * @param StringLiteral $middle_name |
||
56 | * @param StringLiteral $last_name |
||
57 | */ |
||
58 | 8 | public function __construct(StringLiteral $first_name, StringLiteral $middle_name, StringLiteral $last_name) |
|
64 | |||
65 | /** |
||
66 | * Returns the first name |
||
67 | * |
||
68 | * @return StringLiteral |
||
69 | */ |
||
70 | 1 | public function getFirstName() |
|
74 | |||
75 | /** |
||
76 | * Returns the middle name |
||
77 | * |
||
78 | * @return StringLiteral |
||
79 | */ |
||
80 | 1 | public function getMiddleName() |
|
84 | |||
85 | /** |
||
86 | * Returns the last name |
||
87 | * |
||
88 | * @return StringLiteral |
||
89 | */ |
||
90 | 1 | public function getLastName() |
|
94 | |||
95 | /** |
||
96 | * Returns the full name |
||
97 | * |
||
98 | * @return StringLiteral |
||
99 | */ |
||
100 | 5 | public function getFullName() |
|
110 | |||
111 | /** |
||
112 | * Tells whether two names are equal by comparing their values |
||
113 | * |
||
114 | * @param ValueObjectInterface $name |
||
115 | * @return bool |
||
116 | */ |
||
117 | 2 | public function sameValueAs(ValueObjectInterface $name) |
|
125 | |||
126 | /** |
||
127 | * Returns the full name |
||
128 | * |
||
129 | * @return string |
||
130 | */ |
||
131 | 1 | public function __toString() |
|
135 | } |
||
136 |
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.