| Total Complexity | 8 |
| Total Lines | 56 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | class Parameters implements \ArrayAccess |
||
| 22 | { |
||
| 23 | private $configs = array(); |
||
| 24 | |||
| 25 | public function all() |
||
| 26 | { |
||
| 27 | return $this->configs; |
||
| 28 | } |
||
| 29 | |||
| 30 | public function get($name) |
||
| 31 | { |
||
| 32 | if (!array_key_exists($name, $this->configs)) { |
||
| 33 | throw new InvalidArgumentException('Parameters key "'.$name.'" not exists.'); |
||
| 34 | } |
||
| 35 | |||
| 36 | return $this->configs[$name]; |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * {@inheritdoc} |
||
| 41 | */ |
||
| 42 | public function offsetExists($offset) |
||
| 43 | { |
||
| 44 | return isset($this->configs[$offset]); |
||
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * {@inheritdoc} |
||
| 49 | */ |
||
| 50 | public function offsetGet($offset) |
||
| 51 | { |
||
| 52 | return $this->configs[$offset]; |
||
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * {@inheritdoc} |
||
| 57 | */ |
||
| 58 | public function offsetSet($offset, $value): void |
||
| 61 | } |
||
| 62 | |||
| 63 | /** |
||
| 64 | * {@inheritdoc} |
||
| 65 | */ |
||
| 66 | public function offsetUnset($offset): void |
||
| 69 | } |
||
| 70 | |||
| 71 | /** |
||
| 72 | * @param array $configs |
||
| 73 | */ |
||
| 74 | public function setConfigs(array $configs): void |
||
| 79 |