@@ 31-38 (lines=8) @@ | ||
28 | return new static($startDate, $endDate); |
|
29 | } |
|
30 | ||
31 | public static function months(int $numberOfMonths): Period |
|
32 | { |
|
33 | $endDate = Carbon::today(); |
|
34 | ||
35 | $startDate = Carbon::today()->subMonths($numberOfMonths)->startOfDay(); |
|
36 | ||
37 | return new static($startDate, $endDate); |
|
38 | } |
|
39 | ||
40 | public static function years(int $numberOfYears): Period |
|
41 | { |
|
@@ 40-47 (lines=8) @@ | ||
37 | return new static($startDate, $endDate); |
|
38 | } |
|
39 | ||
40 | public static function years(int $numberOfYears): Period |
|
41 | { |
|
42 | $endDate = Carbon::today(); |
|
43 | ||
44 | $startDate = Carbon::today()->subYears($numberOfYears)->startOfDay(); |
|
45 | ||
46 | return new static($startDate, $endDate); |
|
47 | } |
|
48 | ||
49 | public function __construct(DateTime $startDate, DateTime $endDate) |
|
50 | { |