Total Complexity | 5 |
Total Lines | 45 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
20 | trait ArrayAccessTrait{ |
||
21 | |||
22 | /** |
||
23 | * @var array |
||
24 | */ |
||
25 | protected $array = []; |
||
26 | |||
27 | /** |
||
28 | * @var int |
||
29 | */ |
||
30 | protected $offset = 0; |
||
31 | |||
32 | /** |
||
33 | * @link http://php.net/manual/arrayaccess.offsetexists.php |
||
34 | * @inheritdoc |
||
35 | */ |
||
36 | public function offsetExists($offset):bool{ |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * @link http://php.net/manual/arrayaccess.offsetget.php |
||
42 | * @inheritdoc |
||
43 | */ |
||
44 | public function offsetGet($offset){ |
||
46 | } |
||
47 | |||
48 | /** |
||
49 | * @link http://php.net/manual/arrayaccess.offsetset.php |
||
50 | * @inheritdoc |
||
51 | */ |
||
52 | public function offsetSet($offset, $value):void{ |
||
53 | |||
54 | $offset !== null |
||
55 | ? $this->array[$offset] = $value |
||
56 | : $this->array[] = $value; |
||
57 | } |
||
58 | |||
59 | /** |
||
60 | * @link http://php.net/manual/arrayaccess.offsetunset.php |
||
61 | * @inheritdoc |
||
62 | */ |
||
63 | public function offsetUnset($offset):void{ |
||
65 | } |
||
66 | |||
68 |