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

MediaThumbnail   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 getTime() 0 4 1
A setTime() 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 MediaThumbnail implements MediaThumbnailInterface
14
{
15
    /**
16
     * @var string
17
     */
18
    protected $url;
19
20
    /**
21
     * @var int
22
     */
23
    protected $width;
24
25
    /**
26
     * @var int
27
     */
28
    protected $height;
29
30
    /**
31
     * @var DateTime
32
     */
33
    protected $time;
34
35
36
    /**
37
     * @return string
38
     */
39 3
    public function getUrl() : ? string
40
    {
41 3
        return $this->url;
42
    }
43
44
    /**
45
     * @param  string $url
46
     * @return MediaThumbnailInterface
47
     */
48 3
    public function setUrl(?string $url) : MediaThumbnailInterface
49
    {
50 3
        $this->url = $url;
51
52 3
        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 MediaThumbnailInterface
66
     */
67 3
    public function setWidth(?int $width) : MediaThumbnailInterface
68
    {
69 3
        $this->width = $width;
70
71 3
        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 MediaThumbnailInterface
85
     */
86 3
    public function setHeight(?int $height) : MediaThumbnailInterface
87
    {
88 3
        $this->height = $height;
89
90 3
        return $this;
91
    }
92
93
    /**
94
     * @return DateTime
95
     */
96 2
    public function getTime() : ? \DateTime
97
    {
98 2
        return $this->time;
99
    }
100
101
    /**
102
     * @param  \DateTime $time
103
     * @return MediaThumbnailInterface
104
     */
105 1
    public function setTime(? \DateTime $time) : MediaThumbnailInterface
106
    {
107 1
        $this->time = $time;
0 ignored issues
show
Documentation Bug introduced by
It seems like $time of type object<DateTime> is incompatible with the declared type object<FeedIo\Feed\Item\DateTime> of property $time.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
108
109 1
        return $this;
110
    }
111
}
112