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.
Passed
Pull Request — master (#231)
by Yong
09:44 queued 05:23
created

ArrayAccessTrait   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 9
c 0
b 0
f 0
dl 0
loc 46
ccs 12
cts 12
cp 1
rs 10
wmc 5

4 Methods

Rating   Name   Duplication   Size   Complexity  
A offsetGet() 0 9 2
A offsetUnset() 0 3 1
A offsetSet() 0 3 1
A offsetExists() 0 3 1
1
<?php
2
3
namespace AlibabaCloud\Client\Traits;
4
5
/**
6
 * Trait ArrayAccessTrait
7
 *
8
 * @package   AlibabaCloud\Client\Traits
9
 */
10
trait ArrayAccessTrait
11
{
12
    /**
13
     * This method returns a reference to the variable to allow for indirect
14
     * array modification (e.g., $foo['bar']['baz'] = 'qux').
15
     *
16
     * @param string $offset
17
     *
18
     * @return mixed|null
19
     */
20 1
    public function & offsetGet($offset)
21
    {
22 1
        if (isset($this->data[$offset])) {
23 1
            return $this->data[$offset];
24
        }
25
26 1
        $value = null;
27
28 1
        return $value;
29
    }
30
31
    /**
32
     * @param string       $offset
33
     * @param string|mixed $value
34
     */
35 1
    public function offsetSet($offset, $value)
36
    {
37 1
        $this->data[$offset] = $value;
0 ignored issues
show
Bug Best Practice introduced by
The property data does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
38 1
    }
39
40
    /**
41
     * @param string $offset
42
     *
43
     * @return bool
44
     */
45 1
    public function offsetExists($offset)
46
    {
47 1
        return isset($this->data[$offset]);
48
    }
49
50
    /**
51
     * @param string $offset
52
     */
53 1
    public function offsetUnset($offset)
54
    {
55 1
        unset($this->data[$offset]);
56 1
    }
57
}
58