for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php declare(strict_types=1);
namespace Stratadox\Di;
use ArrayAccess;
use Closure;
use Psr\Container\NotFoundExceptionInterface as NotFound;
final class ArrayAdapter implements ArrayAccess
{
private $container;
/**
* @param Container $container
*/
public function __construct(Container $container)
$this->container = $container;
}
* @param string $offset
* @return bool
public function offsetExists($offset): bool
return $this->container->has($offset);
* @return mixed
* @throws InvalidServiceDefinition
* @throws NotFound
public function offsetGet($offset)
return $this->container->get($offset);
* @param Closure $value
public function offsetSet($offset, $value): void
$this->container->set($offset, $value);
public function offsetUnset($offset): void
$this->container->forget($offset);