GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Pull Request — master (#59)
by
unknown
04:48
created

Arc::setBackgroundColor()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 2
nc 2
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Halfpastfour\PHPChartJS\Options\Elements;
4
5
6
use Halfpastfour\PHPChartJS\ArraySerializableInterface;
7
use Halfpastfour\PHPChartJS\Delegate\ArraySerializable;
8
use Zend\Json\Json;
9
10
class Arc implements ArraySerializableInterface, \JsonSerializable
11
{
12
    use ArraySerializable;
13
14
    /**
15
     * Arc fill color.
16
     * @default 'rgba(0,0,0,0.1)'
17
     * @var string
18
     */
19
    private $backgroundColor;
20
21
    /**
22
     * Arc stroke color.
23
     * @default '#fff'
24
     * @var string
25
     */
26
    private $borderColor;
27
28
    /**
29
     * Arc stroke width.
30
     * @default 2
31
     * @var int
32
     */
33
    private $borderWidth;
34
35
    /**
36
     * @return string
37
     */
38
    public function getBackgroundColor()
39
    {
40
        return $this->backgroundColor;
41
    }
42
43
    /**
44
     * @param string $backgroundColor
45
     * @return Arc
46
     */
47
    public function setBackgroundColor($backgroundColor)
48
    {
49
        $this->backgroundColor = is_null($backgroundColor) ? null : strval($backgroundColor);
0 ignored issues
show
introduced by
The condition is_null($backgroundColor) is always false.
Loading history...
50
        return $this;
51
    }
52
53
    /**
54
     * @return string
55
     */
56
    public function getBorderColor()
57
    {
58
        return $this->borderColor;
59
    }
60
61
    /**
62
     * @param string $borderColor
63
     * @return Arc
64
     */
65
    public function setBorderColor($borderColor)
66
    {
67
        $this->borderColor = is_null($borderColor) ? null : strval($borderColor);
0 ignored issues
show
introduced by
The condition is_null($borderColor) is always false.
Loading history...
68
        return $this;
69
    }
70
71
    /**
72
     * @return int
73
     */
74
    public function getBorderWidth()
75
    {
76
        return $this->borderWidth;
77
    }
78
79
    /**
80
     * @param int $borderWidth
81
     * @return Arc
82
     */
83
    public function setBorderWidth($borderWidth)
84
    {
85
        $this->borderWidth = intval($borderWidth);
86
        return $this;
87
    }
88
89
    /**
90
     * @return string
91
     * @throws \ReflectionException
92
     * @throws \Zend_Reflection_Exception
93
     */
94
    public function jsonSerialize()
95
    {
96
        return Json::encode($this->getArrayCopy());
97
    }
98
}