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