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

MediaEmbed   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 99
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 8
lcom 0
cbo 0
dl 0
loc 99
ccs 20
cts 20
cp 1
rs 10
c 0
b 0
f 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A getUrl() 0 4 1
A setUrl() 0 6 1
A getWidth() 0 4 1
A setWidth() 0 6 1
A getHeight() 0 4 1
A setHeight() 0 6 1
A getParams() 0 4 1
A setParams() 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 MediaEmbed implements MediaEmbedInterface
14
{
15
    /**
16
     /**
17
     * @var string
18
     */
19
    protected $url;
20
21
    /**
22
     * @var int
23
     */
24
    protected $width;
25
26
    /**
27
     * @var int
28
     */
29
    protected $height;
30
31
    /**
32
     * @var array
33
     */
34
    protected $params = array();
35
36
    /**
37
     * @return string
38
     */
39 2
    public function getUrl() : ?string
40
    {
41 2
        return $this->url;
42
    }
43
44
    /**
45
     * @param  string $url
46
     * @return MediaEmbedInterface
47
     */
48 2
    public function setUrl(?string $url) : MediaEmbedInterface
49
    {
50 2
        $this->url = $url;
51
52 2
        return $this;
53
    }
54
55
    /**
56
     * @return int
57
     */
58 2
    public function getWidth() : ?int
59
    {
60 2
        return $this->width;
61
    }
62
63
    /**
64
     * @param  int $width
65
     * @return MediaEmbedInterface
66
     */
67 2
    public function setWidth(?int $width) : MediaEmbedInterface
68
    {
69 2
        $this->width = $width;
70
71 2
        return $this;
72
    }
73
74
    /**
75
     * @return int
76
     */
77 2
    public function getHeight() : ?int
78
    {
79 2
        return $this->height;
80
    }
81
82
    /**
83
     * @param  int $height
84
     * @return MediaEmbedInterface
85
     */
86 2
    public function setHeight(?int $height) : MediaEmbedInterface
87
    {
88 2
        $this->height = $height;
89
90 2
        return $this;
91
    }
92
93
    /**
94
     * @return array
95
     */
96 2
    public function getParams() : array
97
    {
98 2
        return $this->params;
99
    }
100
101
    /**
102
     * @param  array $params
103
     * @return MediaEmbedInterface
104
     */
105 2
    public function setParams(array $params) : MediaEmbedInterface
106
    {
107 2
        $this->params = $params;
108
109 2
        return $this;
110
    }
111
}
112