/** * @param ContainerInterface $container */ public function __construct(ContainerInterface $container = null) { if (null === $container) { $container = new Container(); } $this->relayBuilder = new RelayBuilder(); $this->container = $container; $this->errorHandler = $container->get(Handler\ErrorInterface::class); $this->notFoundHandler = $container->get(Handler\NotFoundInterface::class); $this->view = $container->get(View\Manager::class); }
/** * @param ContainerInterface $container */ public function __construct(ContainerInterface $container = null) { if (null === $container) { $container = new Container(); $container->addServiceProvider(new ServiceProvider()); } $this->router = new Router(); $this->serviceContainer = $container; $this->viewManager = $container->get(View\Manager::class); }
/** * @return EntityManager */ protected function em() { return $this->container->get(EntityManager::class); }
/** * @dataProvider instanceProvider * @param string $class */ public function testInstances($class) { $this->assertInstanceOf($class, $this->container->get($class)); }