/** * PHP-DIのコンテナを初期化する。 */ protected function initializeContainer() { parent::initializeContainer(); $builder = new \DI\ContainerBuilder(); $builder->wrapContainer($this->getContainer()); $builder->useAnnotations(true); $this->getContainer()->setFallbackContainer($builder->build()); }
/** * @return ContainerInterface */ private function getPHPDIContainer() { if ($this->phpdiContainer === null) { $builder = new \DI\ContainerBuilder(); $builder->wrapContainer($this->getContainer()); $this->phpdiContainer = $this->buildPHPDIContainer($builder); } return $this->phpdiContainer; }