GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Feature::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 5
cts 5
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 3
crap 1
1
<?php
2
3
namespace Speicher210\Monsum\Api\Model;
4
5
use JMS\Serializer\Annotation as JMS;
6
7
/**
8
 * Feature model.
9
 */
10
class Feature
11
{
12
    /**
13
     * The code / title of the feature.
14
     *
15
     * @var string
16
     *
17
     * @JMS\Type("string")
18
     * @JMS\SerializedName("CODE")
19
     */
20
    protected $code;
21
22
    /**
23
     * Quantity.
24
     *
25
     * @var integer
26
     *
27
     * @JMS\Type("integer")
28
     * @JMS\SerializedName("QUANTITY")
29
     */
30
    protected $quantity;
31
32
    /**
33
     * The value of the feature.
34
     *
35
     * @var string
36
     *
37
     * @JMS\Type("string")
38
     * @JMS\SerializedName("VALUE")
39
     */
40
    protected $value;
41
42
    /**
43
     * Constructor.
44
     *
45
     * @param string $code The code.
46
     * @param integer $quantity The quantity.
47
     * @param string $value The value.
48
     */
49 6
    public function __construct($code, $quantity, $value)
50
    {
51 6
        $this->setCode($code);
52 6
        $this->setQuantity($quantity);
53 6
        $this->setValue($value);
54 6
    }
55
56
    /**
57
     * Get the code.
58
     *
59
     * @return string
60
     */
61
    public function getCode()
62
    {
63
        return $this->code;
64
    }
65
66
    /**
67
     * Set the code.
68
     *
69
     * @param string $code The code.
70
     * @return Feature
71
     */
72 6
    public function setCode($code)
73
    {
74 6
        $this->code = $code;
75
76 6
        return $this;
77
    }
78
79
    /**
80
     * Get the quantity.
81
     *
82
     * @return integer
83
     */
84
    public function getQuantity()
85
    {
86
        return $this->quantity;
87
    }
88
89
    /**
90
     * Set the quantity.
91
     *
92
     * @param integer $quantity The quantity.
93
     * @return Feature
94
     */
95 6
    public function setQuantity($quantity)
96
    {
97 6
        if ($quantity < 1) {
98
            throw new \InvalidArgumentException('Quantity must be bigger than 0.');
99
        }
100 6
        $this->quantity = $quantity;
101
102 6
        return $this;
103
    }
104
105
    /**
106
     * Get the value.
107
     *
108
     * @return string
109
     */
110
    public function getValue()
111
    {
112
        return $this->value;
113
    }
114
115
    /**
116
     * Set the value.
117
     *
118
     * @param string $value The value.
119
     * @return Feature
120
     */
121 6
    public function setValue($value)
122
    {
123 6
        $this->value = $value;
124
125 6
        return $this;
126
    }
127
}
128