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.

MPNSRaw::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 1
1
<?php
2
3
/*
4
 * (c) Alexander Zhukov <[email protected]>
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 Zbox\UnifiedPush\Message\Type;
11
12
use Zbox\UnifiedPush\Exception\InvalidArgumentException;
13
14
/**
15
 * Class MPNSRaw
16
 * @package Zbox\UnifiedPush\Message\Type
17
 */
18
class MPNSRaw extends MPNSBase
19
{
20
    const MESSAGE_TYPE = 'raw';
21
22
    const DELAY_INTERVAL_IMMEDIATE  = 3;
23
    const DELAY_INTERVAL_450        = 13;
24
    const DELAY_INTERVAL_900        = 23;
25
26
    /**
27
     * Custom payload parameters
28
     *
29
     * @var array
30
     */
31
    private $_payload;
32
33
    /**
34
     * @param array $data
35
     */
36
    public function __construct(array $data = array())
37
    {
38
        $this->recipientCollection = new \ArrayIterator();
39
40
        foreach ($data as $key => $value) {
41
            $this->$key = $value;
42
        }
43
44
        return $this;
0 ignored issues
show
Bug introduced by
Constructors do not have meaningful return values, anything that is returned from here is discarded. Are you sure this is correct?
Loading history...
45
    }
46
47
    /**
48
     * @param string $name
49
     */
50
    public function __get($name)
51
    {
52
        if (empty($this->_payload[$name])) {
53
            throw new InvalidArgumentException(sprintf("Payload parameter '%s' is not defined", $name));
54
        }
55
56
        return $this->_payload[$name];
57
    }
58
59
    /**
60
     * @param string $name
61
     * @param mixed $value
62
     */
63
    public function __set($name, $value)
64
    {
65
        $this->_payload[$name] = htmlspecialchars($value);
66
    }
67
68
    /**
69
     * @return array
70
     */
71
    public function getRawPayload()
72
    {
73
        return $this->_payload;
74
    }
75
}
76