ArrayProxyTrait::offsetGet()   A
last analyzed

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
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Equip\Tools;
4
5
trait ArrayProxyTrait
6
{
7
    // SessionInterface
8
    abstract public function has($key);
9
10
    // SessionInterface
11
    abstract public function get($key, $default = null);
12
13
    // SessionInterface
14
    abstract public function set($key, $value);
15
16
    // SessionInterface
17
    abstract public function del($key);
18
19
    // ArrayAccess
20 3
    public function offsetExists($offset)
21
    {
22 3
        return $this->has($offset);
23
    }
24
25
    // ArrayAccess
26 2
    public function offsetGet($offset)
27
    {
28 2
        return $this->get($offset);
29
    }
30
31
    // ArrayAccess
32 4
    public function offsetSet($offset, $value)
33
    {
34 4
        return $this->set($offset, $value);
35
    }
36
37
    // ArrayAccess
38 1
    public function offsetUnset($offset)
39
    {
40 1
        return $this->del($offset);
41
    }
42
}
43