Total Complexity | 11 |
Total Lines | 57 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
7 | class Date |
||
8 | { |
||
9 | private $start; |
||
10 | private $end; |
||
11 | private $format; |
||
12 | private $value; |
||
13 | private $year; |
||
14 | |||
15 | /** |
||
16 | * Constructor |
||
17 | * |
||
18 | */ |
||
19 | public function __construct($value, $options = []) |
||
20 | { |
||
21 | $this->start = $options->start ?? null; |
||
22 | $this->end = $options->end ?? null; |
||
23 | $this->format = $options->format ?? 'd M Y'; |
||
24 | $this->value = $value; |
||
25 | $this->year = DateTime::createFromFormat($this->format, $this->value)->format('Y'); |
||
26 | } |
||
27 | |||
28 | public function isAdate() |
||
29 | { |
||
30 | return DateTime::createFromFormat($this->format, $this->value); |
||
31 | } |
||
32 | |||
33 | public function isDateBetween($start = null, $end = null) |
||
44 | } |
||
45 | |||
46 | public function minimum($start = null) |
||
54 | } |
||
55 | |||
56 | public function maximum($end = null) |
||
66 |