ArrayAccessTrait   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 44
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A offsetExists() 0 4 1
A offsetGet() 0 4 1
A offsetSet() 0 4 1
A offsetUnset() 0 4 1
getStorage() 0 1 ?
1
<?php
2
3
namespace Shrikeh\Collection;
4
5
/**
6
 * Trait ArrayAccessTrait
7
 * @package Shrikeh\Collection
8
 */
9
trait ArrayAccessTrait
10
{
11
    /**
12
     * @param $offset
13
     * @return mixed
14
     */
15
    public function offsetExists($offset)
16
    {
17
        return $this->getStorage()->offsetExists($offset);
18
    }
19
20
    /**
21
     * @param $offset
22
     * @return mixed
23
     */
24
    public function offsetGet($offset)
25
    {
26
        return $this->getStorage()->offsetGet($offset);
27
    }
28
29
    /**
30
     * @param $offset
31
     * @param $data
32
     * @return mixed
33
     */
34
    public function offsetSet($offset, $data)
35
    {
36
        return $this->getStorage()->offsetSet($offset, $data);
37
    }
38
39
    /**
40
     * @param $offset
41
     * @return mixed
42
     */
43
    public function offsetUnset($offset)
44
    {
45
        return $this->getStorage()->offsetUnset($offset);
46
    }
47
48
    /**
49
     * @return mixed
50
     */
51
    abstract protected function getStorage();
52
}
53