Bullet   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 62
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 5
Bugs 2 Features 1
Metric Value
wmc 6
c 5
b 2
f 1
lcom 1
cbo 1
dl 0
loc 62
ccs 18
cts 18
cp 1
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A setOrientation() 0 6 1
A getOrientation() 0 4 1
A setItem() 0 6 1
A getItem() 0 4 1
A getData() 0 7 1
1
<?php
2
3
namespace CarlosIO\Geckoboard\Widgets;
4
5
/**
6
 * Class Bullet.
7
 */
8
class Bullet extends Widget
9
{
10
    protected $item;
11
    protected $orientation;
12
    protected $dataset;
13
14 2
    public function __construct()
15
    {
16 2
        $this->dataset = array();
17 2
        $this->orientation = 'horizontal';
18 2
    }
19
20
    /**
21
     * @param $orientation
22
     *
23
     * @return $this
24
     */
25 1
    public function setOrientation($orientation)
26
    {
27 1
        $this->orientation = $orientation;
28
29 1
        return $this;
30
    }
31
32
    /**
33
     * @return string
34
     */
35 2
    public function getOrientation()
36
    {
37 2
        return $this->orientation;
38
    }
39
40
    /**
41
     * @param $item
42
     *
43
     * @return $this
44
     */
45 1
    public function setItem($item)
46
    {
47 1
        $this->item = $item;
48
49 1
        return $this;
50
    }
51
52 1
    public function getItem()
53
    {
54 1
        return $this->item;
55
    }
56
57
    /**
58
     * Get data in array format.
59
     *
60
     * @return array
61
     */
62 1
    public function getData()
63
    {
64
        return array(
65 1
            'orientation' => $this->getOrientation(),
66 1
            'item' => $this->getItem()->toArray(),
67 1
        );
68
    }
69
}
70