| 1 | <?php |
||
| 10 | class NullableArray implements \ArrayAccess |
||
| 11 | { |
||
| 12 | private $data; |
||
| 13 | |||
| 14 | 124 | public function __construct(array $arr = []) |
|
| 18 | |||
| 19 | /** |
||
| 20 | * {@inheritdoc} |
||
| 21 | */ |
||
| 22 | public function offsetExists($offset) |
||
| 26 | |||
| 27 | /** |
||
| 28 | * {@inheritdoc} |
||
| 29 | */ |
||
| 30 | 118 | public function offsetGet($offset) |
|
| 31 | { |
||
| 32 | 118 | if (isset($this->data[$offset])) |
|
| 33 | 118 | { |
|
| 34 | return $this->data[$offset]; |
||
| 35 | } |
||
| 36 | |||
| 37 | 118 | return null; |
|
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * {@inheritdoc} |
||
| 42 | */ |
||
| 43 | 118 | public function offsetSet($offset, $value) |
|
| 51 | |||
| 52 | /** |
||
| 53 | * {@inheritdoc} |
||
| 54 | */ |
||
| 55 | public function offsetUnset($offset) |
||
| 62 | } |
||
| 63 |