Conditions | 4 |
Paths | 1 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
12 | public static function validateDateRange(DateTimeInterface $start, DateTimeInterface $end) |
||
13 | { |
||
14 | $start = new Chronos($start); |
||
|
|||
15 | $end = new Chronos($end); |
||
16 | |||
17 | if ( |
||
18 | $start->isFuture() || |
||
19 | $end->isFuture() || |
||
20 | $start > $end |
||
21 | ) { |
||
22 | throw new DateException('Date range is incorrect'); |
||
23 | } |
||
24 | |||
25 | return true; |
||
26 | } |
||
28 |