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 ( 2e10ac...ed1d01 )
by Henrik
9s
created

PlainMessage::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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