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.

Repository   A
last analyzed

Complexity

Total Complexity 11

Size/Duplication

Total Lines 100
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 18
dl 0
loc 100
rs 10
c 1
b 0
f 0
wmc 11

9 Methods

Rating   Name   Duplication   Size   Complexity  
A offsetExists() 0 3 1
A __set() 0 3 1
A offsetGet() 0 3 1
A offsetSet() 0 3 1
A set() 0 5 1
A __construct() 0 3 1
A offsetUnset() 0 3 1
A all() 0 3 1
A except() 0 15 3
1
<?php
2
3
namespace Honeybadger\Support;
4
5
class Repository implements \ArrayAccess
6
{
7
    /**
8
     * @var array
9
     */
10
    protected $items = [];
11
12
    public function __construct(array $items = [])
13
    {
14
        $this->items = $items;
15
    }
16
17
    /**
18
     * @param  string  $key
19
     * @param  mixed  $value
20
     * @return array
21
     */
22
    public function set(string $key, $value): array
23
    {
24
        $this->items[$key] = $value;
25
26
        return $this->items;
27
    }
28
29
    /**
30
     * @param  string   $key
31
     * @param  mixed  $value
32
     * @return array
33
     */
34
    public function __set(string $key, $value): array
35
    {
36
        return $this->set($key, $value);
37
    }
38
39
    /**
40
     * @return array
41
     */
42
    public function all(): array
43
    {
44
        return $this->items;
45
    }
46
47
    /**
48
     * @param  string|int $offset
49
     * @return bool
50
     */
51
    public function offsetExists($offset): bool
52
    {
53
        return isset($this->items[$offset]);
54
    }
55
56
    /**
57
     * @param  int|string  $offset
58
     * @return mixed
59
     */
60
    public function offsetGet($offset)
61
    {
62
        return $this->items[$offset];
63
    }
64
65
    /**
66
     * @param  int|string  $offset
67
     * @param  mixed  $value
68
     * @return void
69
     */
70
    public function offsetSet($offset, $value): void
71
    {
72
        $this->items[$offset] = $value;
73
    }
74
75
    /**
76
     * @param  int|string  $offset
77
     * @return void
78
     */
79
    public function offsetUnset($offset): void
80
    {
81
        unset($this->items[$offset]);
82
    }
83
84
    /**
85
     * Return all values except those specified.
86
     *
87
     * @param string|array $keys
88
     * @return array
89
     */
90
    public function except($keys): array
91
    {
92
        $items = $this->items;
93
94
        if (is_array($keys)) {
95
            foreach ($keys as $key) {
96
                unset($items[$key]);
97
            }
98
99
            return $items;
100
        }
101
102
        unset($items[$keys]);
103
104
        return $items;
105
    }
106
}
107