Conditions | 5 |
Paths | 6 |
Total Lines | 17 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 5.583 |
Changes | 5 | ||
Bugs | 3 | Features | 1 |
1 | <?php |
||
48 | 1 | public function __construct($from, $to = null) |
|
49 | { |
||
50 | 1 | if (isset($to)) { |
|
51 | $from = ($from instanceof \DateTime) ? $from : new \DateTime((string)$from); |
||
52 | $to = ($to instanceof \DateTime) ? $to : new \DateTime((string)$to); |
||
53 | $day = new \DateTime($from->format('Y-m-d')); |
||
54 | } else { |
||
55 | 1 | $from = ($from instanceof \DateTime) ? $from : new \DateTime((string)$from); |
|
56 | 1 | $day = clone $from; |
|
57 | 1 | $to = clone $from; |
|
58 | 1 | $to = $to->add(new \DateInterval('PT23H59M59S')); |
|
59 | } |
||
60 | |||
61 | 1 | $this->from = $from; |
|
62 | 1 | $this->to = $to; |
|
63 | 1 | $this->day = $day; |
|
64 | 1 | } |
|
65 | } |
||
66 |