1 | <?php |
||
16 | trait InteractWithTimeTrait |
||
17 | { |
||
18 | /** |
||
19 | * Get the number of seconds until the given DateTime. |
||
20 | * |
||
21 | * @param DateTimeInterface|DateInterval|int $delay |
||
22 | * |
||
23 | * @return int |
||
24 | */ |
||
25 | protected function secondsUntil($delay): int |
||
33 | |||
34 | /** |
||
35 | * Get the "available at" UNIX timestamp. |
||
36 | * |
||
37 | * @param DateTimeInterface|DateInterval|int $delay |
||
38 | * |
||
39 | * @return int |
||
40 | */ |
||
41 | protected function availableAt($delay = 0): int |
||
49 | |||
50 | /** |
||
51 | * If the given value is an interval, convert it to a DateTime instance. |
||
52 | * |
||
53 | * @param \DateTimeInterface|\DateInterval|int $delay |
||
54 | * |
||
55 | * @return \DateTimeInterface|int |
||
56 | */ |
||
57 | protected function parseDateInterval($delay) |
||
65 | |||
66 | /** |
||
67 | * Get the current system time as a UNIX timestamp. |
||
68 | * |
||
69 | * @return int |
||
70 | */ |
||
71 | protected function currentTime(): int |
||
75 | } |
||
76 |