/** * @return \Ikwattro\GithubEvent\EventHandler */ public function build() { $extension = new GithubEventExtension(); $this->serviceContainer->registerExtension($extension); $this->serviceContainer->loadFromExtension($extension->getAlias(), $this->getConfiguration()); $this->serviceContainer->compile(); return $this; }
/** * @return \Neoxygen\Neogen\Neogen */ public function build() { $extension = new NeogenExtension(); $this->serviceContainer->registerExtension($extension); $this->serviceContainer->loadFromExtension($extension->getAlias(), $this->getConfiguration()); $this->serviceContainer->compile(); $this->getParserManager()->registerParser(new YamlFileParser()); $this->getParserManager()->registerParser(new CypherPattern()); return $this; }
/** */ private function prepareContainer(ContainerInterface $container) { foreach ($this->getDefaultExtensions() as $ext) { $container->registerExtension($ext); $container->loadFromExtension($ext->getAlias()); } }
/** * Registers a container extension. * * @param ExtensionInterface $extension The container extension. * * @return Application For method chaining. * * @throws ApplicationException If the extension could not be registered. */ public function registerExtension(ExtensionInterface $extension) { if (!$this->container instanceof ContainerBuilder) { throw ApplicationException::notContainerBuilder(); // @codeCoverageIgnore } $this->container->registerExtension($extension); $this->setDefinition($this->container, 'extension.' . $extension->getAlias(), function (ContainerBuilder $container) use($extension) { $alias = $extension->getAlias(); $container->setParameter(self::getId("extension.{$alias}.class"), get_class($extension)); $definition = new Definition('%' . self::getId("extension.{$alias}.class") . '%'); $definition->addTag(self::getId('extension')); return $definition; }); return $this; }