DateBetween::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
3
namespace JD\FormBundle\Form\Model;
4
5
use DateTime;
6
7
final class DateBetween
8
{
9
    /**
10
     * @var DateTime|null
11
     */
12
    private $from;
13
14
    /**
15
     * @var DateTime|null
16
     */
17
    private $to;
18
19
    /**
20
     * @param DateTime|null $from
21
     * @param DateTime|null $to
22
     */
23
    public function __construct(DateTime $from = null, DateTime $to = null)
24
    {
25
        $this->from = $from;
26
        $this->to   = $to;
27
    }
28
29
    /**
30
     * @return DateTime|null
31
     */
32
    public function getFrom()
33
    {
34
        return $this->from;
35
    }
36
37
    /**
38
     * @param DateTime|null $from
39
     */
40
    public function setFrom(DateTime $from = null)
41
    {
42
        $this->from = $from;
43
    }
44
45
    /**
46
     * @return DateTime|null
47
     */
48
    public function getTo()
49
    {
50
        return $this->to;
51
    }
52
53
    /**
54
     * @param DateTime|null $to
55
     */
56
    public function setTo(DateTime $to = null)
57
    {
58
        $this->to = $to;
59
    }
60
}
61