Total Complexity | 5 |
Total Lines | 53 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
20 | trait ArrayAccessTrait |
||
21 | { |
||
22 | /** |
||
23 | * Check. |
||
24 | * |
||
25 | * @param string $offset |
||
26 | * |
||
27 | * @return bool |
||
28 | */ |
||
29 | 2 | public function offsetExists($offset) |
|
30 | { |
||
31 | 2 | return isset($this->data[$offset]); |
|
32 | } |
||
33 | |||
34 | /** |
||
35 | * Get. |
||
36 | * |
||
37 | * @param string $offset |
||
38 | * |
||
39 | * @return mixed |
||
40 | */ |
||
41 | 16 | public function offsetGet($offset) |
|
42 | { |
||
43 | 16 | if (isset($this->data[$offset])) { |
|
44 | 14 | return $this->data[$offset]; |
|
45 | } |
||
46 | |||
47 | 6 | return false; |
|
48 | } |
||
49 | |||
50 | /** |
||
51 | * Store. |
||
52 | * |
||
53 | * @param string $offset |
||
54 | * @param mixed $value |
||
55 | * |
||
56 | * @return void |
||
57 | */ |
||
58 | 14 | public function offsetSet($offset, $value) |
|
61 | 14 | } |
|
62 | |||
63 | /** |
||
64 | * Delete. |
||
65 | * |
||
66 | * @param string $offset |
||
67 | * |
||
68 | * @return void |
||
69 | */ |
||
70 | 2 | public function offsetUnset($offset) |
|
73 | 2 | } |
|
74 | } |
||
75 |