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 | 24 | public function __construct(\DateTime $start, \DateTime $end) |
|
27 | { |
||
28 | 24 | if ($start > $end) { |
|
29 | 3 | throw new \InvalidArgumentException("Pause can't start after ending"); |
|
30 | } |
||
31 | |||
32 | 21 | if ($start->format('Y-m-d') !== $end->format('Y-m-d')) { |
|
33 | 3 | throw new \InvalidArgumentException("Pause must end in the same day"); |
|
34 | } |
||
35 | |||
36 | 18 | $this->start = $start; |
|
37 | 18 | $this->end = $end; |
|
38 | 18 | } |
|
39 | |||
89 |