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
Push — master ( bbc0b5...c16fec )
by halfpastfour
01:57 queued 12s
created

Arc::jsonSerialize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

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