Total Complexity | 2 |
Total Lines | 25 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | class Carbonate extends AbstractService |
||
11 | { |
||
12 | // todo: add year, month & week methods |
||
13 | // todo: add methods that accept positives or negative ints to determine sub or add |
||
14 | |||
15 | /** |
||
16 | * Create a Carbon datetime object representing $x days ago. |
||
17 | * |
||
18 | * @param int $daysAgo |
||
19 | * @return Carbon |
||
20 | */ |
||
21 | public static function daysAgo(int $daysAgo): Carbon |
||
22 | { |
||
23 | return Carbon::now()->subDays($daysAgo); |
||
24 | } |
||
25 | |||
26 | /** |
||
27 | * Create a Carbon datetime object representing $x days from now. |
||
28 | * |
||
29 | * @param int $daysFromNow |
||
30 | * @return Carbon |
||
31 | */ |
||
32 | public static function daysHence(int $daysFromNow): Carbon |
||
35 | } |
||
36 | } |
||
37 |