Crosshair::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace CMEN\GoogleChartsBundle\GoogleCharts\Options;
4
5
/**
6
 * @author Christophe Meneses
7
 */
8
class Crosshair
9
{
10
    use ColorTrait;
11
12
    use OpacityTrait;
13
14
    use OrientationTrait;
15
16
    /**
17
     * @var Focused
18
     */
19
    protected $focused;
20
21
    /**
22
     * @var Selected
23
     */
24
    protected $selected;
25
26
    /**
27
     * Value can be :
28
     * 'both' : display on both focus and selection
29
     * 'focus' : display on focus only
30
     * 'selection' : display on selection only.
31
     *
32
     * @var string
33
     */
34
    protected $trigger;
35
36 3
    public function __construct()
37
    {
38 3
        $this->focused = new Focused();
39 3
        $this->selected = new Selected();
40
    }
41
42 1
    public function getFocused(): Focused
43
    {
44 1
        return $this->focused;
45
    }
46
47 1
    public function getSelected(): Selected
48
    {
49 1
        return $this->selected;
50
    }
51
52
    /**
53
     * @return $this
54
     */
55 1
    public function setTrigger(string $trigger)
56
    {
57 1
        $this->trigger = $trigger;
58
59 1
        return $this;
60
    }
61
}
62