ArrayAccessTrait::offsetGet()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 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