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 function hours(): int |
||
38 | |||
39 | public function minutes(): int |
||
43 | |||
44 | public static function fromDateTime(DateTimeInterface $dateTime): self |
||
48 | |||
49 | public function isSame(self $time): bool |
||
53 | |||
54 | public function isAfter(self $time): bool |
||
66 | |||
67 | public function isBefore(self $time): bool |
||
75 | |||
76 | public function isSameOrAfter(self $time): bool |
||
80 | |||
81 | public function diffInMinutes(self $time): int |
||
85 | |||
86 | public function toDateTime(DateTime $date = null): DateTime |
||
90 | |||
91 | public function format(string $format = 'H:i'): string |
||
95 | |||
96 | public function __toString(): string |
||
100 | } |
||
101 |