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.

Layout::padding()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
c 2
b 0
f 0
nc 2
nop 0
dl 0
loc 7
rs 10
1
<?php
2
3
namespace Halfpastfour\PHPChartJS\Options;
4
5
use Halfpastfour\PHPChartJS\ArraySerializableInterface;
6
use Halfpastfour\PHPChartJS\Delegate\ArraySerializable;
7
use Halfpastfour\PHPChartJS\Options\Layout\Padding;
8
use JsonSerializable;
9
10
/**
11
 * Class Layout
12
 *
13
 * @package Halfpastfour\PHPChartJS\Options
14
 */
15
class Layout implements ArraySerializableInterface, JsonSerializable
16
{
17
    use ArraySerializable;
18
19
    /**
20
     * @var int|Padding
21
     */
22
    private $padding;
23
24
    /**
25
     * @param int $padding
26
     */
27
    public function setPadding($padding)
28
    {
29
        $this->padding = intval($padding);
30
    }
31
32
    /**
33
     * @return int|Padding
34
     */
35
    public function getPadding()
36
    {
37
        return $this->padding;
38
    }
39
40
    /**
41
     * @return Padding
42
     */
43
    public function padding()
44
    {
45
        if (is_null($this->padding)) {
46
            $this->padding = new Padding();
47
        }
48
49
        return $this->padding;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->padding also could return the type integer which is incompatible with the documented return type Halfpastfour\PHPChartJS\Options\Layout\Padding.
Loading history...
50
    }
51
52
    /**
53
     * @return array
54
     */
55
    public function jsonSerialize()
56
    {
57
        return $this->getArrayCopy();
58
    }
59
}
60