Entry   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 78
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 4
Bugs 1 Features 2
Metric Value
wmc 8
c 4
b 1
f 2
lcom 1
cbo 0
dl 0
loc 78
ccs 25
cts 25
cp 1
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A setValue() 0 6 1
A setLabel() 0 6 1
A getLabel() 0 4 1
A getValue() 0 4 1
A toArray() 0 16 3
1
<?php
2
3
namespace CarlosIO\Geckoboard\Data\Funnel;
4
5
/**
6
 * Class Entry.
7
 */
8
class Entry
9
{
10
    /**
11
     * @var string
12
     */
13
    protected $value;
14
15
    /**
16
     * @var string
17
     */
18
    protected $label;
19
20 1
    public function __construct()
21
    {
22 1
        $this->value = null;
23 1
        $this->label = null;
24 1
    }
25
26
    /**
27
     * @param $value
28
     *
29
     * @return $this
30
     */
31 1
    public function setValue($value)
32
    {
33 1
        $this->value = $value;
34
35 1
        return $this;
36
    }
37
38
    /**
39
     * @param  $label
40
     *
41
     * @return $this
42
     */
43 1
    public function setLabel($label)
44
    {
45 1
        $this->label = $label;
46
47 1
        return $this;
48
    }
49
50
    /**
51
     * @return string
52
     */
53 1
    public function getLabel()
54
    {
55 1
        return $this->label;
56
    }
57
58
    /**
59
     * @return string
60
     */
61 1
    public function getValue()
62
    {
63 1
        return $this->value;
64
    }
65
66
    /**
67
     * @return array
68
     */
69 1
    public function toArray()
70
    {
71 1
        $result = array();
72
73 1
        $value = $this->getValue();
74 1
        if (null !== $value) {
75 1
            $result['value'] = (string) $value;
76 1
        }
77
78 1
        $label = $this->getLabel();
79 1
        if (null !== $label) {
80 1
            $result['label'] = $label;
81 1
        }
82
83 1
        return $result;
84
    }
85
}
86