Completed
Pull Request — master (#167)
by
unknown
04:24
created

Media::getLength()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
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
class Media implements MediaInterface
14
{
15
    /**
16
     * @var string
17
     */
18
    protected $name;
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 getName() : string
39
    {
40
        return $this->name;
41
    }
42
43
    /**
44
     * @param string $name
45
     * @return MediaInterface
46
     */
47 4
    public function setName(string $name): MediaInterface
48
    {
49 4
        $this->name = $name;
50
51 4
        return $this;
52
    }
53
54
    /**
55
     * @return string
56
     */
57 5
    public function getType() : ? string
58
    {
59 5
        return $this->type;
60
    }
61
62
    /**
63
     * @param  string $type
64
     * @return MediaInterface
65
     */
66 7
    public function setType(?string $type) : MediaInterface
67
    {
68 7
        $this->type = $type;
69
70 7
        return $this;
71
    }
72
73
    /**
74
     * @return string
75
     */
76 6
    public function getUrl() : ? string
77
    {
78 6
        return $this->url;
79
    }
80
81
    /**
82
     * @param  string $url
83
     * @return MediaInterface
84
     */
85 6
    public function setUrl(?string $url) : MediaInterface
86
    {
87 6
        $this->url = $url;
88
89 6
        return $this;
90
    }
91
92
    /**
93
     * @return string
94
     */
95 3
    public function getLength() : ? string
96
    {
97 3
        return $this->length;
98
    }
99
100
    /**
101
     * @param  string $length
102
     * @return MediaInterface
103
     */
104 6
    public function setLength(?string $length) : MediaInterface
105
    {
106 6
        $this->length = $length;
107
108 6
        return $this;
109
    }
110
}
111