| Conditions | 4 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 35 | 4 | protected function matchDateRange($begin, $end) |
|
| 36 | { |
||
| 37 | 4 | if ($begin > $end) { |
|
| 38 | 1 | throw new RunTimeException('End date cannot be before start date'); |
|
| 39 | } |
||
| 40 | |||
| 41 | 3 | $now = date('Y-m-d'); |
|
| 42 | |||
| 43 | 3 | if ($now < $begin) { |
|
| 44 | 1 | return false; |
|
| 45 | } |
||
| 46 | |||
| 47 | 2 | if ($end < $now) { |
|
| 48 | 1 | return false; |
|
| 49 | } |
||
| 50 | |||
| 51 | 1 | return true; |
|
| 52 | } |
||
| 53 | } |
||
| 54 |