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

Cookie   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 91
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 0
dl 0
loc 91
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 1
A jsonSerialize() 0 12 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 Cookie implements \JsonSerializable
18
{
19
    /**
20
     * Name.
21
     *
22
     * @var string
23
     */
24
    private $name;
25
26
    /**
27
     * Value.
28
     *
29
     * @var mixed
30
     */
31
    private $value;
32
33
    /**
34
     * Path.
35
     *
36
     * @var string
37
     */
38
    private $path;
39
40
    /**
41
     * Domain.
42
     *
43
     * @var string
44
     */
45
    private $domain;
46
47
    /**
48
     * HTTP Only.
49
     *
50
     * @var bool
51
     */
52
    private $httpOnly;
53
54
    /**
55
     * Secure.
56
     *
57
     * @var bool
58
     */
59
    private $secure;
60
61
    /**
62
     * Expires.
63
     *
64
     * @var int
65
     */
66
    private $expires;
67
68
    /**
69
     * Internal constructor.
70
     *
71
     * @param string $name
72
     * @param mixed  $value
73
     * @param string $path
74
     * @param string $domain
75
     * @param bool   $httpOnly (default: true)
76
     * @param bool   $secure   (default: false)
77
     * @param int    $expires  (default: null)
78
     */
79
    public function __construct($name, $value, $path, $domain, $httpOnly = true, $secure = false, $expires = null)
80
    {
81
        $this->name = $name;
82
        $this->value = $value;
83
        $this->path = $path;
84
        $this->domain = $domain;
85
        $this->httpOnly = $httpOnly;
86
        $this->secure = $secure;
87
        $this->expires = $expires;
88
    }
89
90
    /**
91
     * Format data for JSON serialization.
92
     *
93
     * @return array
94
     */
95
    public function jsonSerialize()
96
    {
97
        return array_filter(array(
98
            'name' => $this->name,
99
            'value' => $this->value,
100
            'path' => $this->path,
101
            'domain' => $this->domain,
102
            'httponly' => $this->httpOnly,
103
            'secure' => $this->secure,
104
            'expires' => $this->expires,
105
        ));
106
    }
107
}
108