Conditions | 5 |
Paths | 6 |
Total Lines | 17 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 30 |
Changes | 5 | ||
Bugs | 3 | Features | 1 |
1 | <?php |
||
48 | public function __construct($from, $to = null) |
||
49 | { |
||
50 | 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 | $from = ($from instanceof \DateTime) ? $from : new \DateTime((string)$from); |
||
56 | $day = clone $from; |
||
57 | $to = clone $from; |
||
58 | $to = $to->add(new \DateInterval('PT23H59M59S')); |
||
59 | } |
||
60 | |||
61 | $this->from = $from; |
||
62 | $this->to = $to; |
||
63 | $this->day = $day; |
||
64 | } |
||
65 | } |
||
66 |