Completed
Pull Request — master (#257)
by Éloi
02:08
created

MediaText::getEnd()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php declare(strict_types=1);
2
/*
3
 * This file is part of the feed-io package.
4
 *
5
 * (c) Alexandre Debril <[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 FeedIo\Feed\Item;
12
13
abstract class MediaTextType extends MediaConstant
14
{
15
    const Plain = 1;
16
    const HTML = 2;
17
18
    const VALUES = array(
19
        null => MediaTextType::Plain,
20
        "plain" => MediaTextType::Plain,
21
        "html" => MediaTextType::HTML,
22
    );
23
}
24
25
26
class MediaText
27
{
28
    /**
29
     * @var string
30
     */
31
    protected $value;
32
33
    /**
34
     * @var int
35
     */
36
    protected $type;
37
38
    /**
39
     * @var string
40
     */
41
    protected $lang;
42
43
    /**
44
     * @var \DateTime
45
     */
46
    protected $start;
47
48
    /**
49
     * @var \DateTime
50
     */
51
    protected $end;
52
53
    /**
54
     * @param  string $value
55
     * @return MediaText
56
     */
57 2
    public function setValue(string $value) : MediaText
58
    {
59 2
        $this->value = $value;
60 2
        return $this;
61
    }
62
63 2
    public function getValue() : string
64
    {
65 2
        return $this->value;
66
    }
67
68
    /**
69
     * @param  int $type
70
     * @return MediaText
71
     */
72 2
    public function setType(int $type) : MediaText
73
    {
74 2
        $this->type = $type;
75 2
        return $this;
76
    }
77
78 2
    public function getType() : int
79
    {
80 2
        return $this->type;
81
    }
82
83
    /**
84
     * @param  string $lang
85
     * @return MediaText
86
     */
87 2
    public function setLang(? string $lang) : MediaText
88
    {
89 2
        $this->lang = $lang;
90 2
        return $this;
91
    }
92
93 2
    public function getLang() : ? string
94
    {
95 2
        return $this->lang;
96
    }
97
98
    /**
99
     * @param  \DateTime $start
100
     * @return MediaText
101
     */
102 1
    public function setStart(? \DateTime $start) : MediaText
103
    {
104 1
        $this->start = $start;
105 1
        return $this;
106
    }
107
108 2
    public function getStart() : ? \DateTime
109
    {
110 2
        return $this->start;
111
    }
112
113
    /**
114
     * @param  \DateTime $end
115
     * @return MediaText
116
     */
117 1
    public function setEnd(? \DateTime $end) : MediaText
118
    {
119 1
        $this->end = $end;
120 1
        return $this;
121
    }
122
123 2
    public function getEnd() : ? \DateTime
124
    {
125 2
        return $this->end;
126
    }
127
}
128