Completed
Pull Request — master (#248)
by
unknown
02:23
created

Media   A

Complexity

Total Complexity 15

Size/Duplication

Total Lines 180
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 89.19%

Importance

Changes 0
Metric Value
wmc 15
lcom 1
cbo 0
dl 0
loc 180
ccs 33
cts 37
cp 0.8919
rs 10
c 0
b 0
f 0

15 Methods

Rating   Name   Duplication   Size   Complexity  
A getNodeName() 0 4 1
A setNodeName() 0 6 1
A isThumbnail() 0 4 1
A getType() 0 4 1
A setType() 0 6 1
A getUrl() 0 4 1
A setUrl() 0 6 1
A getLength() 0 4 1
A setLength() 0 6 1
A getTitle() 0 4 1
A setTitle() 0 6 1
A getDescription() 0 4 1
A setDescription() 0 6 1
A getThumbnail() 0 4 1
A setThumbnail() 0 6 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
class Media implements MediaInterface
14
{
15
    /**
16
     * @var string
17
     */
18
    protected $nodeName;
19
20
    /**
21
     * @var string
22
     */
23
    protected $type;
24
25
    /**
26
     * @var string
27
     */
28
    protected $url;
29
30
    /**
31
     * @var string
32
     */
33
    protected $length;
34
35
    /**
36
     * @var string
37
     */
38
    protected $title;
39
40
    /**
41
     * @var string
42
     */
43
    protected $description;
44
45
    /**
46
     * @var string
47
     */
48
    protected $thumbnail;
49
50
51
    /**
52
     * @return string
53
     */
54
    public function getNodeName() : string
55
    {
56
        return $this->nodeName;
57
    }
58
59
    /**
60
     * @param string $nodeName
61
     * @return MediaInterface
62
     */
63 5
    public function setNodeName(string $nodeName) : MediaInterface
64
    {
65 5
        $this->nodeName = $nodeName;
66
67 5
        return $this;
68
    }
69
70
    /**
71
     * @return bool
72
     */
73
    public function isThumbnail() : bool
74
    {
75
        return $this->nodeName === 'media:thumbnail';
76
    }
77
78
    /**
79
     * @return string
80
     */
81 5
    public function getType() : ? string
82
    {
83 5
        return $this->type;
84
    }
85
86
    /**
87
     * @param  string $type
88
     * @return MediaInterface
89
     */
90 7
    public function setType(?string $type) : MediaInterface
91
    {
92 7
        $this->type = $type;
93
94 7
        return $this;
95
    }
96
97
    /**
98
     * @return string
99
     */
100 7
    public function getUrl() : ? string
101
    {
102 7
        return $this->url;
103
    }
104
105
    /**
106
     * @param  string $url
107
     * @return MediaInterface
108
     */
109 7
    public function setUrl(?string $url) : MediaInterface
110
    {
111 7
        $this->url = $url;
112
113 7
        return $this;
114
    }
115
116
    /**
117
     * @return string
118
     */
119 3
    public function getLength() : ? string
120
    {
121 3
        return $this->length;
122
    }
123
124
    /**
125
     * @param  string $length
126
     * @return MediaInterface
127
     */
128 6
    public function setLength(?string $length) : MediaInterface
129
    {
130 6
        $this->length = $length;
131
132 6
        return $this;
133
    }
134
135
136
    /**
137
     * @return string
138
     */
139 1
    public function getTitle() : ? string
140
    {
141 1
        return $this->title;
142
    }
143
144
    /**
145
     * @param  string $title
146
     * @return MediaInterface
147
     */
148 1
    public function setTitle(?string $title) : MediaInterface
149
    {
150 1
        $this->title = $title;
151
152 1
        return $this;
153
    }
154
155
    /**
156
     * @return string
157
     */
158 1
    public function getDescription() : ? string
159
    {
160 1
        return $this->description;
161
    }
162
163
    /**
164
     * @param  string $description
165
     * @return MediaInterface
166
     */
167 1
    public function setDescription(?string $description) : MediaInterface
168
    {
169 1
        $this->description = $description;
170
171 1
        return $this;
172
    }
173
174
    /**
175
     * @return string
176
     */
177 1
    public function getThumbnail() : ? string
178
    {
179 1
        return $this->thumbnail;
180
    }
181
182
    /**
183
     * @param  string $thumbnail
184
     * @return MediaInterface
185
     */
186 1
    public function setThumbnail(?string $thumbnail) : MediaInterface
187
    {
188 1
        $this->thumbnail = $thumbnail;
189
190 1
        return $this;
191
    }
192
}
193