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 ( f9b38c...aac4f4 )
by Márk
10s
created

PlainMessage::__unset()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Bernard\Message;
4
5
use Bernard\Message;
6
7
/**
8
 * Simple message that gets you started.
9
 * It has a name and an array of arguments.
10
 * It does not enforce any types or properties so be careful on relying them
11
 * being there.
12
 */
13
final class PlainMessage implements Message, \ArrayAccess
14
{
15
    private $name;
16
    private $arguments;
17
18
    /**
19
     * @param string $name
20
     * @param array  $arguments
21
     */
22 50
    public function __construct($name, array $arguments = [])
23
    {
24 50
        $this->name = $name;
25 50
        $this->arguments = $arguments;
26 50
    }
27
28
    /**
29
     * {@inheritdoc}
30
     */
31 34
    public function getName()
32
    {
33 34
        return $this->name;
34
    }
35
36
    /**
37
     * @return array
38
     */
39 2
    public function all()
40
    {
41 2
        return $this->arguments;
42
    }
43
44
    /**
45
     * Returns the argument if found or null.
46
     *
47
     * @param string $name
48
     *
49
     * @return mixed
50
     */
51 2
    public function get($name)
52
    {
53 2
        return $this->has($name) ? $this->arguments[$name] : null;
54
    }
55
56
    /**
57
     * Checks whether the arguments contain the given key.
58
     *
59
     * @param string $name
60
     *
61
     * @return bool
62
     */
63 2
    public function has($name)
64
    {
65 2
        return array_key_exists($name, $this->arguments);
66
    }
67
68 1
    public function offsetGet($offset)
69
    {
70 1
        return $this->get($offset);
71
    }
72
73 1
    public function offsetExists($offset)
74
    {
75 1
        return $this->has($offset);
76
    }
77
78 1
    public function offsetSet($offset, $value)
79
    {
80 1
        throw new \LogicException('Message is immutable');
81
    }
82
83 1
    public function offsetUnset($offset)
84
    {
85 1
        throw new \LogicException('Message is immutable');
86
    }
87
88 1
    public function __get($property)
89
    {
90 1
        return $this->get($property);
91
    }
92
93 1
    public function __isset($property)
94
    {
95 1
        return $this->has($property);
96
    }
97
98 1
    public function __set($property, $value)
99
    {
100 1
        throw new \LogicException('Message is immutable');
101
    }
102
103 1
    public function __unset($property)
104
    {
105 1
        throw new \LogicException('Message is immutable');
106
    }
107
}
108