1 | <?php |
||
8 | class DateTimeWithTimeZone implements ValueObjectInterface |
||
9 | { |
||
10 | /** @var DateTime */ |
||
11 | protected $dateTime; |
||
12 | |||
13 | /** @var TimeZone */ |
||
14 | protected $timeZone; |
||
15 | |||
16 | /** |
||
17 | * Returns a new DateTime object from native values |
||
18 | * |
||
19 | * @param int $year |
||
|
|||
20 | * @param string $month |
||
21 | * @param int $day |
||
22 | * @param int $hour |
||
23 | * @param int $minute |
||
24 | * @param int $second |
||
25 | * @param string $timezone |
||
26 | * |
||
27 | * @return DateTimeWithTimeZone |
||
28 | */ |
||
29 | 1 | public static function fromNative() |
|
38 | |||
39 | /** |
||
40 | * Returns a new DateTime from a native PHP \DateTime |
||
41 | * |
||
42 | * @param \DateTime $nativeDatetime |
||
43 | * |
||
44 | * @return DateTimeWithTimeZone |
||
45 | */ |
||
46 | 1 | public static function fromNativeDateTime(\DateTime $nativeDatetime) |
|
53 | |||
54 | /** |
||
55 | * Returns a DateTimeWithTimeZone object using current DateTime and default TimeZone |
||
56 | * |
||
57 | * @return DateTimeWithTimeZone |
||
58 | */ |
||
59 | 1 | public static function now() |
|
63 | |||
64 | /** |
||
65 | * Returns a new DateTimeWithTimeZone object |
||
66 | * |
||
67 | * @param DateTime $datetime |
||
68 | * @param TimeZone $timezone |
||
69 | */ |
||
70 | 9 | public function __construct(DateTime $datetime, TimeZone $timezone = null) |
|
75 | |||
76 | /** |
||
77 | * Tells whether two DateTimeWithTimeZone are equal by comparing their values |
||
78 | * |
||
79 | * @param ValueObjectInterface $dateTimeWithTimeZone |
||
80 | * |
||
81 | * @return bool |
||
82 | */ |
||
83 | 4 | public function sameValueAs(ValueObjectInterface $dateTimeWithTimeZone) |
|
92 | |||
93 | /** |
||
94 | * Tells whether two DateTimeWithTimeZone represents the same timestamp |
||
95 | * |
||
96 | * @param ValueObjectInterface $dateTimeWithTimeZone |
||
97 | * |
||
98 | * @return bool |
||
99 | */ |
||
100 | 1 | public function sameTimestampAs(ValueObjectInterface $dateTimeWithTimeZone) |
|
108 | |||
109 | /** |
||
110 | * Returns datetime from current DateTimeWithTimeZone |
||
111 | * |
||
112 | * @return DateTime |
||
113 | */ |
||
114 | 8 | public function getDateTime() |
|
118 | |||
119 | /** |
||
120 | * Returns timezone from current DateTimeWithTimeZone |
||
121 | * |
||
122 | * @return TimeZone |
||
123 | */ |
||
124 | 8 | public function getTimeZone() |
|
128 | |||
129 | /** |
||
130 | * Returns a native PHP \DateTime version of the current DateTimeWithTimeZone |
||
131 | * |
||
132 | * @return \DateTime |
||
133 | */ |
||
134 | 2 | public function toNativeDateTime() |
|
153 | |||
154 | /** |
||
155 | * Returns DateTime as string in format "Y-n-j G:i:s e" |
||
156 | * |
||
157 | * @return string |
||
158 | */ |
||
159 | 2 | public function __toString() |
|
163 | } |
||
164 |
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.