Completed
Push — master ( f0e4dd...d193d8 )
by Alex
11s
created

Media::isThumbnail()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
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
     * @return string
37
     */
38
    public function getNodeName() : string
39
    {
40
        return $this->nodeName;
41
    }
42
43
    /**
44
     * @param string $nodeName
45
     * @return MediaInterface
46
     */
47 4
    public function setNodeName(string $nodeName) : MediaInterface
48
    {
49 4
        $this->nodeName = $nodeName;
50
51 4
        return $this;
52
    }
53
54
    /**
55
     * @return bool
56
     */
57
    public function isThumbnail() : bool
58
    {
59
        return $this->nodeName === 'media:thumbnail';
60
    }
61
62
    /**
63
     * @return string
64
     */
65 5
    public function getType() : ? string
66
    {
67 5
        return $this->type;
68
    }
69
70
    /**
71
     * @param  string $type
72
     * @return MediaInterface
73
     */
74 7
    public function setType(?string $type) : MediaInterface
75
    {
76 7
        $this->type = $type;
77
78 7
        return $this;
79
    }
80
81
    /**
82
     * @return string
83
     */
84 6
    public function getUrl() : ? string
85
    {
86 6
        return $this->url;
87
    }
88
89
    /**
90
     * @param  string $url
91
     * @return MediaInterface
92
     */
93 6
    public function setUrl(?string $url) : MediaInterface
94
    {
95 6
        $this->url = $url;
96
97 6
        return $this;
98
    }
99
100
    /**
101
     * @return string
102
     */
103 3
    public function getLength() : ? string
104
    {
105 3
        return $this->length;
106
    }
107
108
    /**
109
     * @param  string $length
110
     * @return MediaInterface
111
     */
112 6
    public function setLength(?string $length) : MediaInterface
113
    {
114 6
        $this->length = $length;
115
116 6
        return $this;
117
    }
118
}
119