1 | <?php |
||
10 | class TimeBuilder |
||
11 | { |
||
12 | /** |
||
13 | * Create a new Time from an array. |
||
14 | * |
||
15 | * @param array $data The data. |
||
16 | * @return Time |
||
17 | 36 | */ |
|
18 | public static function fromArray(array $data): Time |
||
30 | |||
31 | /** |
||
32 | * Create a new time from a string. |
||
33 | * |
||
34 | * @param string $time The time as a string. |
||
35 | * @return Time |
||
36 | * @throws \InvalidArgumentException If the passed time is invalid. |
||
37 | 123 | */ |
|
38 | public static function fromString($time): Time |
||
57 | |||
58 | /** |
||
59 | * Create a new time from a date. |
||
60 | * |
||
61 | * @param \DateTime $date The date. |
||
62 | * @return Time |
||
63 | 156 | */ |
|
64 | public static function fromDate(\DateTime $date): Time |
||
68 | |||
69 | /** |
||
70 | * Create a new time from seconds. |
||
71 | * |
||
72 | * @param integer $seconds The seconds. |
||
73 | * @return Time |
||
74 | 30 | */ |
|
75 | public static function fromSeconds(int $seconds): Time |
||
89 | } |
||
90 |