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 — master ( 6c5ffd...9c9abb )
by Alexander
02:23
created

MPNSRaw::createPayload()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 17
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 17
rs 9.4285
cc 2
eloc 11
nc 2
nop 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A MPNSRaw::__set() 0 4 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->setMessageIdentifier(uniqid());
39
        $this->recipientCollection = new \ArrayIterator();
40
41
        foreach ($data as $key => $value) {
42
            $this->$key = $value;
43
        }
44
45
        return $this;
46
    }
47
48
    /**
49
     * @param string $name
50
     */
51
    public function __get($name)
52
    {
53
        if (empty($this->_payload[$name])) {
54
            throw new InvalidArgumentException(sprintf("Payload parameter '%s' is not defined", $name));
55
        }
56
57
        return $this->_payload[$name];
58
    }
59
60
    /**
61
     * @param string $name
62
     * @param mixed $value
63
     */
64
    public function __set($name, $value)
65
    {
66
        $this->_payload[$name] = htmlspecialchars($value);
67
    }
68
69
    /**
70
     * @return array
71
     */
72
    public function getRawPayload()
73
    {
74
        return $this->_payload;
75
    }
76
}
77