vendor/overblog/graphql-bundle/src/OverblogGraphQLBundle.php line 23

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace Overblog\GraphQLBundle;
  4. use Overblog\GraphQLBundle\DependencyInjection\Compiler\AliasedPass;
  5. use Overblog\GraphQLBundle\DependencyInjection\Compiler\ConfigParserPass;
  6. use Overblog\GraphQLBundle\DependencyInjection\Compiler\ConfigProcessorPass;
  7. use Overblog\GraphQLBundle\DependencyInjection\Compiler\ExpressionFunctionPass;
  8. use Overblog\GraphQLBundle\DependencyInjection\Compiler\GlobalVariablesPass;
  9. use Overblog\GraphQLBundle\DependencyInjection\Compiler\MutationTaggedServiceMappingTaggedPass;
  10. use Overblog\GraphQLBundle\DependencyInjection\Compiler\ResolverMethodAliasesPass;
  11. use Overblog\GraphQLBundle\DependencyInjection\Compiler\ResolverTaggedServiceMappingPass;
  12. use Overblog\GraphQLBundle\DependencyInjection\Compiler\TypeGeneratorPass;
  13. use Overblog\GraphQLBundle\DependencyInjection\Compiler\TypeTaggedServiceMappingPass;
  14. use Overblog\GraphQLBundle\DependencyInjection\OverblogGraphQLExtension;
  15. use Symfony\Component\DependencyInjection\Compiler\PassConfig;
  16. use Symfony\Component\DependencyInjection\ContainerBuilder;
  17. use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
  18. use Symfony\Component\HttpKernel\Bundle\Bundle;
  19. class OverblogGraphQLBundle extends Bundle
  20. {
  21.     public function boot(): void
  22.     {
  23.         if ($this->container->has('overblog_graphql.cache_compiler')) {
  24.             $this->container->get('overblog_graphql.cache_compiler')->loadClasses();
  25.         }
  26.     }
  27.     /**
  28.      * {@inheritdoc}
  29.      */
  30.     public function build(ContainerBuilder $container): void
  31.     {
  32.         parent::build($container);
  33.         //TypeGeneratorPass must be before TypeTaggedServiceMappingPass
  34.         $container->addCompilerPass(new ConfigParserPass());
  35.         $container->addCompilerPass(new ConfigProcessorPass());
  36.         $container->addCompilerPass(new GlobalVariablesPass());
  37.         $container->addCompilerPass(new ExpressionFunctionPass());
  38.         $container->addCompilerPass(new ResolverMethodAliasesPass());
  39.         $container->addCompilerPass(new AliasedPass());
  40.         $container->addCompilerPass(new TypeGeneratorPass(), PassConfig::TYPE_BEFORE_REMOVING);
  41.         $container->addCompilerPass(new TypeTaggedServiceMappingPass(), PassConfig::TYPE_BEFORE_REMOVING);
  42.         $container->addCompilerPass(new ResolverTaggedServiceMappingPass(), PassConfig::TYPE_BEFORE_REMOVING);
  43.         $container->addCompilerPass(new MutationTaggedServiceMappingTaggedPass(), PassConfig::TYPE_BEFORE_REMOVING);
  44.     }
  45.     public function getContainerExtension()
  46.     {
  47.         if (!$this->extension instanceof ExtensionInterface) {
  48.             $this->extension = new OverblogGraphQLExtension();
  49.         }
  50.         return $this->extension;
  51.     }
  52. }