1 | <?php |
||
9 | class Time |
||
10 | { |
||
11 | /** @var int */ |
||
12 | protected $hours; |
||
13 | |||
14 | /** @var int */ |
||
15 | protected $minutes; |
||
16 | |||
17 | protected function __construct(int $hours, int $minutes) |
||
22 | |||
23 | public static function fromString(string $string): self |
||
33 | |||
34 | public static function fromDateTime(DateTimeInterface $dateTime): self |
||
38 | |||
39 | public function isSame(Time $time): bool |
||
43 | |||
44 | public function isAfter(Time $time): bool |
||
56 | |||
57 | public function isBefore(Time $time): bool |
||
65 | |||
66 | public function isSameOrAfter(Time $time): bool |
||
70 | |||
71 | public function toDateTime(): DateTime |
||
75 | |||
76 | public function format(string $format = 'H:i'): string |
||
80 | |||
81 | public function __toString(): string |
||
85 | } |
||
86 |