1 | <?php |
||
9 | class Date implements ValueObjectInterface |
||
10 | { |
||
11 | /** @var Year */ |
||
12 | protected $year; |
||
13 | |||
14 | /** @var Month */ |
||
15 | protected $month; |
||
16 | |||
17 | /** @var MonthDay */ |
||
18 | protected $day; |
||
19 | |||
20 | /** |
||
21 | * Returns a new Date from native year, month and day values |
||
22 | * |
||
23 | * @param int $year |
||
|
|||
24 | * @param string $month |
||
25 | * @param int $day |
||
26 | * @return Date |
||
27 | */ |
||
28 | 3 | public static function fromNative() |
|
38 | |||
39 | /** |
||
40 | * Returns a new Date from a native PHP \DateTime |
||
41 | * |
||
42 | * @param \DateTime $date |
||
43 | * @return Date |
||
44 | */ |
||
45 | 3 | public static function fromNativeDateTime(\DateTime $date) |
|
53 | |||
54 | /** |
||
55 | * Returns current Date |
||
56 | * |
||
57 | * @return Date |
||
58 | */ |
||
59 | 3 | public static function now() |
|
65 | |||
66 | /** |
||
67 | * Create a new Date |
||
68 | * |
||
69 | * @param Year $year |
||
70 | * @param Month $month |
||
71 | * @param MonthDay $day |
||
72 | * @throws InvalidDateException |
||
73 | */ |
||
74 | 28 | public function __construct(Year $year, Month $month, MonthDay $day) |
|
87 | |||
88 | /** |
||
89 | * Tells whether two Date are equal by comparing their values |
||
90 | * |
||
91 | * @param ValueObjectInterface $date |
||
92 | * @return bool |
||
93 | */ |
||
94 | 12 | public function sameValueAs(ValueObjectInterface $date) |
|
104 | |||
105 | /** |
||
106 | * Get year |
||
107 | * |
||
108 | * @return Year |
||
109 | */ |
||
110 | 22 | public function getYear() |
|
114 | |||
115 | /** |
||
116 | * Get month |
||
117 | * |
||
118 | * @return Month |
||
119 | */ |
||
120 | 22 | public function getMonth() |
|
124 | |||
125 | /** |
||
126 | * Get day |
||
127 | * |
||
128 | * @return MonthDay |
||
129 | */ |
||
130 | 22 | public function getDay() |
|
134 | |||
135 | /** |
||
136 | * Returns a native PHP \DateTime version of the current Date |
||
137 | * |
||
138 | * @return \DateTime |
||
139 | */ |
||
140 | 7 | public function toNativeDateTime() |
|
152 | |||
153 | /** |
||
154 | * Returns date as string in format Y-n-j |
||
155 | * |
||
156 | * @return string |
||
157 | */ |
||
158 | 6 | public function __toString() |
|
162 | } |
||
163 |
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.