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

MediaCredit::setScheme()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
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 MediaCreditScheme extends MediaConstant
14
{
15
    const URN_EBU = 1;
16
    const URN_YVS = 2;
17
18
    const VALUES = array(
19
        null => MediaCreditScheme::URN_EBU,
20
        "urn:ebu" => MediaCreditScheme::URN_EBU,
21
        "urn:yvs" => MediaCreditScheme::URN_YVS,
22
    );
23
}
24
25
class MediaCredit
26
{
27
    /**
28
     * @var int
29
     */
30
    protected $scheme;
31
32
    /**
33
     * @var string
34
     */
35
    protected $role;
36
37
    /**
38
     * @var string
39
     */
40
    protected $value;
41
42
    /**
43
     * @param  int $scheme
44
     * @return MediaCredit
45
     */
46 2
    public function setScheme(int $scheme) : MediaCredit
47
    {
48 2
        $this->scheme = $scheme;
49
50 2
        return $this;
51
    }
52
53
    /**
54
     * @return int
55
     */
56 2
    public function getScheme() : ? int
57
    {
58 2
        return $this->scheme;
59
    }
60
61
    /**
62
     * @param  string $role
63
     * @return MediaCredit
64
     */
65 2
    public function setRole(?string $role) : MediaCredit
66
    {
67 2
        $this->role = $role;
68
69 2
        return $this;
70
    }
71
72 2
    public function getRole() : ? string
73
    {
74 2
        return $this->role;
75
    }
76
77
    /**
78
     * @param  string $value
79
     * @return MediaCredit
80
     */
81 2
    public function setValue(string $value) : MediaCredit
82
    {
83 2
        $this->value = $value;
84
85 2
        return $this;
86
    }
87
88 2
    public function getValue() : string
89
    {
90 2
        return $this->value;
91
    }
92
}
93