Total Complexity | 8 |
Total Lines | 41 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | class ArrayAccessible implements ArrayAccess, IteratorAggregate, Arrayable |
||
14 | { |
||
15 | private $array; |
||
16 | |||
17 | public function __construct(array $array = []) |
||
18 | { |
||
19 | $this->array = $array; |
||
20 | } |
||
21 | |||
22 | public function offsetExists($offset) |
||
25 | } |
||
26 | |||
27 | public function offsetGet($offset) |
||
28 | { |
||
29 | return $this->array[$offset]; |
||
30 | } |
||
31 | |||
32 | public function offsetSet($offset, $value) |
||
33 | { |
||
34 | if (null === $offset) { |
||
35 | $this->array[] = $value; |
||
36 | } else { |
||
37 | $this->array[$offset] = $value; |
||
38 | } |
||
39 | } |
||
40 | |||
41 | public function offsetUnset($offset) |
||
44 | } |
||
45 | |||
46 | public function getIterator() |
||
47 | { |
||
48 | return new ArrayIterator($this->array); |
||
49 | } |
||
50 | |||
51 | public function toArray() |
||
54 | } |
||
55 | } |
||
56 |