for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Northwoods\Container;
use Auryn\Injector;
use Auryn\InjectorException;
use Psr\Container\ContainerInterface;
class InjectorContainer implements ContainerInterface
{
/**
* @var Injector
*/
private $injector;
public function __construct(Injector $injector)
$this->injector = $injector;
}
// ContainerInterface
public function get($id)
if (false === $this->has($id)) {
throw NotFoundException::classDoesNotExist($id);
try {
return $this->injector->make($id);
} catch (InjectorException $e) {
throw ContainerException::couldNotMake($id, $e);
public function has($id)
return class_exists($id);