GraphicalValue::getYear()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 *
4
 */
5
6
/**
7
 * GraphicalValue class
8
 *
9
 * @author Laurent De Coninck <[email protected]>
10
 */
11
class GraphicalValue
12
{
13
14
    /**
15
     * @var int
16
     */
17
    private $value;
18
19
    /**
20
     * @var int
21
     */
22
    private $year;
23
24
    /**
25
     * @var int
26
     */
27
    private $type;
28
29
    /**
30
     * GraphicalValue constructor.
31
     *
32
     * @param int $value
33
     * @param int $year
34
     * @param int $type
35
     */
36
    public function __construct($value, $year, $type)
37
    {
38
        $this->value = $value;
39
        $this->year = $year;
40
        $this->type = $type;
41
    }
42
43
    /**
44
     * @return int
45
     */
46
    public function getValue()
47
    {
48
        return $this->value;
49
    }
50
51
    /**
52
     * @return int
53
     */
54
    public function getYear()
55
    {
56
        return $this->year;
57
    }
58
59
    /**
60
     * @return int
61
     */
62
    public function getType()
63
    {
64
        return $this->type;
65
    }
66
67
    /**
68
     * @param GraphicalValue $value
69
     *
70
     * @return GraphicalValue
71
     */
72
    public function add($value)
73
    {
74
        return new GraphicalValue($this->value + $value->getValue(), $this->year, $this->type);
75
    }
76
77
}