| Total Complexity | 5 |
| Total Lines | 22 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class Context implements ContextInterface |
||
| 8 | { |
||
| 9 | private ArrayObject $collection; |
||
| 10 | |||
| 11 | 2 | public function __construct() |
|
| 12 | { |
||
| 13 | 2 | $this->collection = new ArrayObject(); |
|
| 14 | 2 | } |
|
| 15 | |||
| 16 | 2 | public function get(string $key) |
|
| 17 | { |
||
| 18 | 2 | return $this->has($key) ? $this->collection->offsetGet($key) : null; |
|
| 19 | } |
||
| 20 | |||
| 21 | 2 | public function set(string $key, $value): void |
|
| 22 | { |
||
| 23 | 2 | $this->collection->offsetSet($key, $value); |
|
| 24 | 2 | } |
|
| 25 | |||
| 26 | 2 | public function has(string $key): bool |
|
| 29 | } |
||
| 30 | } |