| Total Complexity | 5 |
| Total Lines | 47 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 9 | final class ArrayAdapter implements ArrayAccess |
||
| 10 | { |
||
| 11 | private $container; |
||
| 12 | |||
| 13 | /** |
||
| 14 | * @param Container $container |
||
| 15 | */ |
||
| 16 | public function __construct(Container $container) |
||
| 17 | { |
||
| 18 | $this->container = $container; |
||
| 19 | } |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @param string $offset |
||
| 23 | * @return bool |
||
| 24 | */ |
||
| 25 | public function offsetExists($offset): bool |
||
| 26 | { |
||
| 27 | return $this->container->has($offset); |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @param string $offset |
||
| 32 | * @return mixed |
||
| 33 | * @throws InvalidServiceDefinition |
||
| 34 | * @throws NotFound |
||
| 35 | */ |
||
| 36 | public function offsetGet($offset) |
||
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * @param string $offset |
||
| 43 | * @param Closure $value |
||
| 44 | */ |
||
| 45 | public function offsetSet($offset, $value): void |
||
| 46 | { |
||
| 47 | $this->container->set($offset, $value); |
||
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * @param string $offset |
||
| 52 | */ |
||
| 53 | public function offsetUnset($offset): void |
||
| 56 | } |
||
| 57 | } |
||
| 58 |