| 1 | <?php declare(strict_types=1); |
||
| 10 | trait ArrayAccessTrait |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * The internal state that this object represents |
||
| 14 | * |
||
| 15 | * @var array |
||
| 16 | */ |
||
| 17 | private $internalState = []; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Sets an internal key with a value. |
||
| 21 | * |
||
| 22 | * @param string $offset |
||
| 23 | * @param mixed $value |
||
| 24 | */ |
||
| 25 | 5 | public function offsetSet($offset, $value) |
|
| 33 | |||
| 34 | /** |
||
| 35 | * Checks whether an internal key exists. |
||
| 36 | * |
||
| 37 | * @param string $offset |
||
| 38 | * |
||
| 39 | * @return bool |
||
| 40 | */ |
||
| 41 | 3 | public function offsetExists(string $offset): bool |
|
| 45 | |||
| 46 | /** |
||
| 47 | * Unsets an internal key. |
||
| 48 | * |
||
| 49 | * @param string $offset |
||
| 50 | */ |
||
| 51 | 1 | public function offsetUnset(string $offset) |
|
| 55 | |||
| 56 | /** |
||
| 57 | * Retrieves an internal key. |
||
| 58 | * |
||
| 59 | * @param string $offset |
||
| 60 | * |
||
| 61 | * @return mixed|null |
||
| 62 | */ |
||
| 63 | 2 | public function offsetGet(string $offset) |
|
| 67 | } |
||
| 68 |