PieSlice::setOffset()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
ccs 0
cts 3
cp 0
crap 2
rs 10
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
    public function __construct()
29
    {
30
        $this->textStyle = new PieSliceTextStyle();
31
    }
32
33
    public function getTextStyle(): PieSliceTextStyle
34
    {
35
        return $this->textStyle;
36
    }
37
38
    /**
39
     * @return $this
40
     */
41
    public function setOffset(float $offset)
42
    {
43
        $this->offset = $offset;
44
45
        return $this;
46
    }
47
}
48