| Total Complexity | 6 |
| Total Lines | 47 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | trait ArrayAccessTrait |
||
| 10 | { |
||
| 11 | |||
| 12 | /** |
||
| 13 | * Determine if the given configuration option exists. |
||
| 14 | * |
||
| 15 | * @param string $key |
||
| 16 | * @return bool |
||
| 17 | */ |
||
| 18 | 2 | public function offsetExists($key) |
|
| 21 | } |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Get a configuration option. |
||
| 25 | * |
||
| 26 | * @param string $key |
||
| 27 | * @return mixed |
||
| 28 | */ |
||
| 29 | 4 | public function offsetGet($key) |
|
| 30 | { |
||
| 31 | 4 | return $this->items[$key]; |
|
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @param string $key |
||
| 36 | * @param mixed $value |
||
| 37 | * @return void |
||
| 38 | */ |
||
| 39 | 21 | public function offsetSet($key, $value) |
|
| 40 | { |
||
| 41 | 21 | if (is_null($key)) { |
|
|
|
|||
| 42 | 15 | $this->items[] = $value; |
|
| 43 | } else { |
||
| 44 | 19 | $this->items[$key] = $value; |
|
| 45 | } |
||
| 46 | 21 | } |
|
| 47 | |||
| 48 | /** |
||
| 49 | * Unset a configuration option. |
||
| 50 | * |
||
| 51 | * @inheritdoc |
||
| 52 | */ |
||
| 53 | 1 | public function offsetUnset($key) |
|
| 56 | 1 | } |
|
| 57 | } |
||
| 58 |