Completed
Pull Request — master (#257)
by Éloi
01:56
created

MediaPrice::getValue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
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
abstract class MediaPriceType extends MediaConstant
14
{
15
    const Free = 1;
16
    const Rent = 2;
17
    const Purchase = 3;
18
    const Package = 4;
19
    const Subscription = 5;
20
21
    const VALUES = array(
22
        "free" => MediaPriceType::Free,
23
        "rent" => MediaPriceType::Rent,
24
        "purchase" => MediaPriceType::Purchase,
25
        "package" => MediaPriceType::Package,
26
        "subscription" => MediaPriceType::Subscription,
27
    );
28
}
29
30
31
class MediaPrice
32
{
33
    /**
34
     * @var int
35
     */
36
    protected $type;
37
38
    /**
39
     * @var float
40
     */
41
    protected $value;
42
43
    /**
44
     * @var string
45
     */
46
    protected $currency;
47
48
    /**
49
     * @param  int $type
50
     * @return MediaPrice
51
     */
52 2
    public function setType(? int $type) : MediaPrice
53
    {
54 2
        $this->type = $type;
55 2
        return $this;
56
    }
57
58 2
    public function getType() : ? int
59
    {
60 2
        return $this->type;
61
    }
62
63
    /**
64
     * @param  float $value
65
     * @return MediaPrice
66
     */
67 2
    public function setValue(? float $value) : MediaPrice
68
    {
69 2
        $this->value = $value;
70 2
        return $this;
71
    }
72
73 2
    public function getValue() : ? float
74
    {
75 2
        return $this->value;
76
    }
77
78
    /**
79
     * @param  string|null currency
80
     * @return MediaPrice
81
     */
82 2
    public function setCurrency(? string $currency) : MediaPrice
83
    {
84 2
        $this->currency = $currency;
85 2
        return $this;
86
    }
87
88 2
    public function getCurrency() : ? string
89
    {
90 2
        return $this->currency;
91
    }
92
}
93