Holiday::getDate()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/*
3
 * This file is part of the Slince/China package.
4
 *
5
 * (c) Slince <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace China\Holiday;
12
13
class Holiday implements HolidayInterface
14
{
15
    /**
16
     * @var string
17
     */
18
    protected $name;
19
20
    /**
21
     * @var string
22
     */
23
    protected $type;
24
25
    /**
26
     * {@inheritdoc}
27
     */
28
    protected $date;
29
30
    public function __construct($name, $type, DateInterface $date)
31
    {
32
        $this->name = $name;
33
        $this->type = $type;
34
        $this->date = $date;
35
    }
36
37
    /**
38
     * {@inheritdoc}
39
     */
40
    public function getName()
41
    {
42
        return $this->name;
43
    }
44
45
    /**
46
     * {@inheritdoc}
47
     */
48
    public function getType()
49
    {
50
        return $this->type;
51
    }
52
53
    /**
54
     * {@inheritdoc}
55
     */
56
    public function getDate()
57
    {
58
        return $this->date;
59
    }
60
61
    /**
62
     * {@inheritdoc}
63
     */
64
    public function jsonSerialize()
65
    {
66
        return [
67
            'name' => $this->name,
68
            'type' => $this->type,
69
            'date' => $this->date,
70
        ];
71
    }
72
}