Completed
Push — master ( 706182...8198d4 )
by Jérémy
01:34
created

Attachment::setSize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace JDecool\JsonFeed;
4
5
/**
6
 * Related resources. Podcasts, for instance, would include an attachment that’s an audio or video file
7
 */
8
class Attachment
9
{
10
    /** @var string */
11
    private $url;
12
13
    /** @var string */
14
    private $mimeType;
15
16
    /** @var string */
17
    private $title;
18
19
    /** @var int|float */
20
    private $size;
21
22
    /** @var int|float */
23
    private $duration;
24
25
    /**
26
     * Constructor
27
     *
28
     * @param string $url
29
     * @param string $mimeType
30
     */
31
    public function __construct($url, $mimeType)
32
    {
33
        $this->url = $url;
34
        $this->mimeType = $mimeType;
35
    }
36
37
    /**
38
     * Get the location of the attachment
39
     *
40
     * @return string
41
     */
42
    public function getUrl()
43
    {
44
        return $this->url;
45
    }
46
47
    /**
48
     * Get the type of the attachment
49
     *
50
     * @return string
51
     */
52
    public function getMimeType()
53
    {
54
        return $this->mimeType;
55
    }
56
57
    /**
58
     * Get the name for the attachment
59
     *
60
     * @return string
61
     */
62
    public function getTitle()
63
    {
64
        return $this->title;
65
    }
66
67
    /**
68
     * Set the name of the attachment
69
     *
70
     * @param string $title
71
     * @return Attachment
72
     */
73
    public function setTitle($title)
74
    {
75
        $this->title = $title;
76
77
        return $this;
78
    }
79
80
    /**
81
     * Get the size of content
82
     *
83
     * @return float|int
84
     */
85
    public function getSize()
86
    {
87
        return $this->size;
88
    }
89
90
    /**
91
     * Set the size of content
92
     *
93
     * @param float|int $size
94
     * @return Attachment
95
     */
96
    public function setSize($size)
97
    {
98
        $this->size = $size;
99
100
        return $this;
101
    }
102
103
    /**
104
     * Get the duration of the attachment
105
     *
106
     * @return float|int
107
     */
108
    public function getDuration()
109
    {
110
        return $this->duration;
111
    }
112
113
    /**
114
     * Specifies how long the attachment takes to listen to or watch
115
     *
116
     * @param float|int $duration
117
     * @return Attachment
118
     */
119
    public function setDuration($duration)
120
    {
121
        $this->duration = $duration;
122
123
        return $this;
124
    }
125
}
126