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

ViewportSize::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
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 ViewportSize 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
     * Internal constructor.
35
     *
36
     * @param int $width
37
     * @param int $height
38
     */
39
    public function __construct($width, $height)
40
    {
41
        $this->width = (int) $width;
42
        $this->height = (int) $height;
43
    }
44
45
    /**
46
     * Format data for JSON serialization.
47
     *
48
     * @return array
49
     */
50
    public function jsonSerialize()
51
    {
52
        return array(
53
            'top' => $this->top,
0 ignored issues
show
Bug introduced by
The property top does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
54
            'left' => $this->left,
0 ignored issues
show
Bug introduced by
The property left does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
55
        );
56
    }
57
}
58