Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
26 | 16 | public function __construct(\DateTime $start, \DateTime $end) |
|
27 | { |
||
28 | 16 | if ($start > $end) { |
|
29 | 4 | throw new \InvalidArgumentException("Pause can't start after ending"); |
|
30 | } |
||
31 | |||
32 | 12 | if ($start->format('Y-m-d') !== $end->format('Y-m-d')) { |
|
33 | 4 | throw new \InvalidArgumentException("Pause must end in the same day"); |
|
34 | } |
||
35 | |||
36 | 8 | $this->start = $start; |
|
37 | 8 | $this->end = $end; |
|
38 | 8 | } |
|
39 | |||
87 |