Bullet::getOrientation()   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 0 Features 1
Metric Value
c 1
b 0
f 1
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\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