| Total Complexity | 13 |
| Total Lines | 68 |
| Duplicated Lines | 0 % |
| Coverage | 96% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class Config implements ArrayAccess |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var array |
||
| 14 | */ |
||
| 15 | protected $config; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Config constructor. |
||
| 19 | * |
||
| 20 | * @param array $config |
||
| 21 | */ |
||
| 22 | 21 | public function __construct(array $config = []) |
|
| 25 | 21 | } |
|
| 26 | |||
| 27 | /** |
||
| 28 | * Get an item from an array using "dot" notation. |
||
| 29 | * |
||
| 30 | * @param string $key |
||
| 31 | * @param mixed $default |
||
| 32 | * |
||
| 33 | * @return mixed |
||
| 34 | */ |
||
| 35 | 23 | public function get($key, $default = null) |
|
| 55 | } |
||
| 56 | |||
| 57 | 1 | public function offsetExists($offset) |
|
| 58 | { |
||
| 59 | 1 | return array_key_exists($offset, $this->config); |
|
| 60 | } |
||
| 61 | |||
| 62 | 4 | public function offsetGet($offset) |
|
| 63 | { |
||
| 64 | 4 | return $this->get($offset); |
|
| 65 | } |
||
| 66 | |||
| 67 | 1 | public function offsetSet($offset, $value) |
|
| 68 | { |
||
| 69 | 1 | if (isset($this->config[$offset])) { |
|
| 70 | 1 | $this->config[$offset] = $value; |
|
| 71 | } |
||
| 72 | 1 | } |
|
| 73 | |||
| 74 | 1 | public function offsetUnset($offset) |
|
| 78 | } |
||
| 79 | 1 | } |
|
| 80 | } |
||
| 81 |