| @@ 272-283 (lines=12) @@ | ||
| 269 | * @return $this |
|
| 270 | * @throws InvalidArgumentException |
|
| 271 | */ |
|
| 272 | public function setHour($hour) |
|
| 273 | { |
|
| 274 | if (is_numeric($hour) && |
|
| 275 | $hour < 0 || $hour > 23 |
|
| 276 | ) { |
|
| 277 | throw new InvalidArgumentException('Invalid hour format', self::ERROR_HOUR); |
|
| 278 | } |
|
| 279 | ||
| 280 | $this->hour = $hour; |
|
| 281 | ||
| 282 | return $this; |
|
| 283 | } |
|
| 284 | ||
| 285 | /** |
|
| 286 | * @return string |
|
| @@ 299-310 (lines=12) @@ | ||
| 296 | * @return $this |
|
| 297 | * @throws InvalidArgumentException |
|
| 298 | */ |
|
| 299 | public function setMinute($minute) |
|
| 300 | { |
|
| 301 | if (is_numeric($minute) && |
|
| 302 | $minute < 0 || $minute > 59 |
|
| 303 | ) { |
|
| 304 | throw new InvalidArgumentException('Invalid minute format', self::ERROR_MINUTE); |
|
| 305 | } |
|
| 306 | ||
| 307 | $this->minute = $minute; |
|
| 308 | ||
| 309 | return $this; |
|
| 310 | } |
|
| 311 | ||
| 312 | /** |
|
| 313 | * @return string |
|
| @@ 326-337 (lines=12) @@ | ||
| 323 | * @return $this |
|
| 324 | * @throws InvalidArgumentException |
|
| 325 | */ |
|
| 326 | public function setMonth($month) |
|
| 327 | { |
|
| 328 | if (is_numeric($month) && |
|
| 329 | $month < 1 || $month > 12 |
|
| 330 | ) { |
|
| 331 | throw new InvalidArgumentException('Invalid month format', self::ERROR_MONTH); |
|
| 332 | } |
|
| 333 | ||
| 334 | $this->month = $month; |
|
| 335 | ||
| 336 | return $this; |
|
| 337 | } |
|
| 338 | ||
| 339 | /** |
|
| 340 | * @return string |
|