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.
Completed
Push — 5.0 ( c6890e...9916e2 )
by Jonny
24:09
created

PaperSize   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 95
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 95
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A setHeader() 0 6 1
A setFooter() 0 6 1
A jsonSerialize() 0 10 1
1
<?php
2
3
/*
4
 * This file is part of the php-phantomjs.
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace JonnyW\PhantomJs\Page;
11
12
/**
13
 * PHP PhantomJs.
14
 *
15
 * @author Jon Wenmoth <[email protected]>
16
 */
17
class PaperSize implements \JsonSerializable
18
{
19
    /**
20
     * Width.
21
     *
22
     * @var int
23
     */
24
    private $width;
25
26
    /**
27
     * Height.
28
     *
29
     * @var int
30
     */
31
    private $height;
32
33
    /**
34
     * Margin.
35
     *
36
     * @var int|JonnyW\PhantomJs\Page\Margin
37
     */
38
    protected $margin;
39
40
    /**
41
     * Header.
42
     *
43
     * @var \JonnyW\PhantomJs\Page\PaperBlock
44
     */
45
    protected $header;
46
47
    /**
48
     * Footer.
49
     *
50
     * @var \JonnyW\PhantomJs\Page\PaperBlock
51
     */
52
    protected $footer;
53
54
    /**
55
     * Internal constructor.
56
     *
57
     * @param int                              $width
58
     * @param int                              $height
59
     * @param int|JonnyW\PhantomJs\Page\Margin $margin (default: 0)
60
     */
61
    public function __construct($width, $height, $margin = 0)
62
    {
63
        $this->width = (int) $width;
64
        $this->height = (int) $height;
65
        $this->margin = $margin;
66
    }
67
68
    /**
69
     * Set header.
70
     *
71
     * @param \JonnyW\PhantomJs\Page\PaperBlock $header
72
     *
73
     * @return |JonnyW\PhantomJs\Page\PaperSize
0 ignored issues
show
Documentation introduced by
The doc-type |JonnyW\PhantomJs\Page\PaperSize could not be parsed: Unknown type name "|" at position 0. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
74
     */
75
    public function setHeader(PaperBlock $header)
76
    {
77
        $this->header = $header;
78
79
        return $this;
80
    }
81
82
    /**
83
     * Set footer.
84
     *
85
     * @param \JonnyW\PhantomJs\Page\PaperBlock $footer
86
     *
87
     * @return |JonnyW\PhantomJs\Page\PaperSize
0 ignored issues
show
Documentation introduced by
The doc-type |JonnyW\PhantomJs\Page\PaperSize could not be parsed: Unknown type name "|" at position 0. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
88
     */
89
    public function setFooter(PaperBlock $footer)
90
    {
91
        $this->footer = $footer;
92
93
        return $this;
94
    }
95
96
    /**
97
     * Format data for JSON serialization.
98
     *
99
     * @return array
100
     */
101
    public function jsonSerialize()
102
    {
103
        return array_filter(array(
104
            'width' => $this->width,
105
            'height' => $this->height,
106
            'margin' => $this->margin,
107
            'header' => $this.header,
108
            'footer' => $this->footer,
109
        ));
110
    }
111
}
112