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

MediaStatus::getReason()   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 MediaStatusValue extends MediaConstant
14
{
15
    const Active = 1;
16
    const Blocked = 2;
17
    const Deleted = 3;
18
19
    const VALUES = array(
20
        "active" => MediaStatusValue::Active,
21
        "blocked" => MediaStatusValue::Blocked,
22
        "deleted" => MediaStatusValue::Deleted,
23
    );
24
}
25
26
27
abstract class MediaRightsStatus extends MediaConstant
28
{
29
    const UserCreated = 1;
30
    const Official = 2;
31
32
    const VALUES = array(
33
        "usercreated" => MediaRightsStatus::UserCreated,
34
        "official" => MediaRightsStatus::Official,
35
    );
36
}
37
38
39
class MediaStatus implements MediaStatusInterface
40
{
41
    /**
42
     * @var int
43
     */
44
    protected $value;
45
46
    /**
47
     * @var string
48
     */
49
    protected $reason;
50
51
    /**
52
     * @return int
53
     */
54 2
    public function getValue() : ?int
55
    {
56 2
        return $this->value;
57
    }
58
59
    /**
60
     * @param  int $value
61
     * @return MediaValueInterface
62
     */
63 2
    public function setValue(?int $value) : MediaStatusInterface
64
    {
65 2
        $this->value = $value;
66
67 2
        return $this;
68
    }
69
70
    /**
71
     * @return string
72
     */
73 2
    public function getReason() : ?string
74
    {
75 2
        return $this->reason;
76
    }
77
78
    /**
79
     * @param  string $reason
80
     * @return MediaStatusInterface
81
     */
82 2
    public function setReason(?string $reason) : MediaStatusInterface
83
    {
84 2
        $this->reason = $reason;
85
86 2
        return $this;
87
    }
88
}
89