| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | 51 | public function __construct(\DateTime $start, \DateTime $end) |
|
| 34 | 51 | { |
|
| 35 | $this->start = $start; |
||
| 36 | 51 | $this->end = $end; |
|
| 37 | 6 | ||
| 38 | 6 | if ($end <= $start) { |
|
| 39 | 6 | throw new \InvalidArgumentException( |
|
| 40 | 6 | \sprintf( |
|
| 41 | 6 | 'The opening date and time "%s" must be before the closing date and time "%s".', |
|
| 42 | 6 | $start->format('Y-m-d H:i:s'), |
|
| 43 | 6 | $end->format('Y-m-d H:i:s') |
|
| 44 | ) |
||
| 45 | 45 | ); |
|
| 46 | } |
||
| 47 | } |
||
| 48 | |||
| 80 |