ArrayProxyTrait   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 38
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
has() 0 1 ?
get() 0 1 ?
set() 0 1 ?
del() 0 1 ?
A offsetExists() 0 4 1
A offsetGet() 0 4 1
A offsetSet() 0 4 1
A offsetUnset() 0 4 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