PieSlice   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 36
ccs 0
cts 7
cp 0
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getTextStyle() 0 3 1
A __construct() 0 3 1
A setOffset() 0 5 1
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