Label::getName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace CarlosIO\Geckoboard\Data\ItemList;
4
5
class Label
6
{
7
    /**
8
     * @var string
9
     */
10
    protected $name;
11
12
    /**
13
     * @var string
14
     */
15
    protected $color;
16
17
    /**
18
     * @return mixed
19
     */
20 2
    public function getColor()
21
    {
22 2
        return $this->color;
23
    }
24
25
    /**
26
     * @param mixed $color
27
     *
28
     * @return $this
29
     */
30 2
    public function setColor($color)
31
    {
32 2
        $this->color = $color;
33
34 2
        return $this;
35
    }
36
37
    /**
38
     * @return string
39
     */
40 2
    public function getName()
41
    {
42 2
        return $this->name;
43
    }
44
45
    /**
46
     * @param string $name
47
     *
48
     * @return $this
49
     */
50 2
    public function setName($name)
51
    {
52 2
        $this->name = $name;
53
54 2
        return $this;
55
    }
56
57
    /**
58
     * Returns an array representation of this object.
59
     *
60
     * @return array
61
     */
62 2
    public function toArray()
63
    {
64 2
        $result = array();
65 2
        $result['name'] = $this->getName();
66 2
        $result['color'] = $this->getColor();
67
68 2
        return $result;
69
    }
70
}
71