vendor/api-platform/core/src/Bridge/Symfony/Bundle/ApiPlatformBundle.php line 36

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the API Platform project.
  4.  *
  5.  * (c) Kévin Dunglas <dunglas@gmail.com>
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. declare(strict_types=1);
  11. namespace ApiPlatform\Core\Bridge\Symfony\Bundle;
  12. use ApiPlatform\Core\Bridge\Symfony\Bundle\DependencyInjection\Compiler\AnnotationFilterPass;
  13. use ApiPlatform\Core\Bridge\Symfony\Bundle\DependencyInjection\Compiler\DataProviderPass;
  14. use ApiPlatform\Core\Bridge\Symfony\Bundle\DependencyInjection\Compiler\DeprecateMercurePublisherPass;
  15. use ApiPlatform\Core\Bridge\Symfony\Bundle\DependencyInjection\Compiler\ElasticsearchClientPass;
  16. use ApiPlatform\Core\Bridge\Symfony\Bundle\DependencyInjection\Compiler\FilterPass;
  17. use ApiPlatform\Core\Bridge\Symfony\Bundle\DependencyInjection\Compiler\GraphQlMutationResolverPass;
  18. use ApiPlatform\Core\Bridge\Symfony\Bundle\DependencyInjection\Compiler\GraphQlQueryResolverPass;
  19. use ApiPlatform\Core\Bridge\Symfony\Bundle\DependencyInjection\Compiler\GraphQlTypePass;
  20. use ApiPlatform\Core\Bridge\Symfony\Bundle\DependencyInjection\Compiler\MetadataAwareNameConverterPass;
  21. use ApiPlatform\Core\Bridge\Symfony\Bundle\DependencyInjection\Compiler\TestClientPass;
  22. use Symfony\Component\DependencyInjection\Compiler\PassConfig;
  23. use Symfony\Component\DependencyInjection\Compiler\ResolveInstanceofConditionalsPass;
  24. use Symfony\Component\DependencyInjection\ContainerBuilder;
  25. use Symfony\Component\HttpKernel\Bundle\Bundle;
  26. /**
  27.  * The Symfony bundle.
  28.  *
  29.  * @author Kévin Dunglas <dunglas@gmail.com>
  30.  */
  31. final class ApiPlatformBundle extends Bundle
  32. {
  33.     /**
  34.      * {@inheritdoc}
  35.      */
  36.     public function build(ContainerBuilder $container)
  37.     {
  38.         parent::build($container);
  39.         $container->addCompilerPass(new DataProviderPass());
  40.         // Run the compiler pass before the {@see ResolveInstanceofConditionalsPass} to allow autoconfiguration of generated filter definitions.
  41.         $container->addCompilerPass(new AnnotationFilterPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION101);
  42.         $container->addCompilerPass(new FilterPass());
  43.         $container->addCompilerPass(new ElasticsearchClientPass());
  44.         $container->addCompilerPass(new GraphQlTypePass());
  45.         $container->addCompilerPass(new GraphQlQueryResolverPass());
  46.         $container->addCompilerPass(new GraphQlMutationResolverPass());
  47.         $container->addCompilerPass(new DeprecateMercurePublisherPass());
  48.         $container->addCompilerPass(new MetadataAwareNameConverterPass());
  49.         $container->addCompilerPass(new TestClientPass());
  50.     }
  51. }