Test Failed
Push — master ( e6b57e...dd7c2d )
by Christophe
07:44
created

PieSlice::setColor()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 5
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
crap 2
1
<?php
2
3
namespace CMEN\GoogleChartsBundle\GoogleCharts\Options\PieChart;
4
5
use CMEN\GoogleChartsBundle\GoogleCharts\Options\ColorTrait;
6
7
/**
8
 * @author Christophe Meneses
9
 */
10
class PieSlice
11
{
12
    use ColorTrait;
13
14
    /**
15
     * How far to separate the slice from the rest of the pie, from 0.0 (not at all) to 1.0 (the pie's radius).
16
     *
17
     * @var float
18
     */
19
    protected $offset;
20
21
    /**
22
     * Overrides the global pieSliceTextStyle for this slice.
23
     *
24
     * @var PieSliceTextStyle
25
     */
26
    protected $textStyle;
27
28
    /**
29
     * PieSlice constructor.
30
     */
31
    public function __construct()
32
    {
33
        $this->textStyle = new PieSliceTextStyle();
34
    }
35
36
    /**
37
     * @return PieSliceTextStyle
38
     */
39
    public function getTextStyle()
40
    {
41
        return $this->textStyle;
42
    }
43
44
    /**
45
     * @param float $offset
46
     *
47
     * @return $this
48
     */
49
    public function setOffset($offset)
50
    {
51
        $this->offset = $offset;
52
53
        return $this;
54
    }
55
}
56