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

  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\Symfony\Bundle;
  12. use ApiPlatform\Symfony\Bundle\DependencyInjection\Compiler\AnnotationFilterPass;
  13. use ApiPlatform\Symfony\Bundle\DependencyInjection\Compiler\AuthenticatorManagerPass;
  14. use ApiPlatform\Symfony\Bundle\DependencyInjection\Compiler\DataProviderPass;
  15. use ApiPlatform\Symfony\Bundle\DependencyInjection\Compiler\DeprecateLegacyIriConverterPass;
  16. use ApiPlatform\Symfony\Bundle\DependencyInjection\Compiler\DeprecateMercurePublisherPass;
  17. use ApiPlatform\Symfony\Bundle\DependencyInjection\Compiler\ElasticsearchClientPass;
  18. use ApiPlatform\Symfony\Bundle\DependencyInjection\Compiler\FilterPass;
  19. use ApiPlatform\Symfony\Bundle\DependencyInjection\Compiler\GraphQlMutationResolverPass;
  20. use ApiPlatform\Symfony\Bundle\DependencyInjection\Compiler\GraphQlQueryResolverPass;
  21. use ApiPlatform\Symfony\Bundle\DependencyInjection\Compiler\GraphQlTypePass;
  22. use ApiPlatform\Symfony\Bundle\DependencyInjection\Compiler\MetadataAwareNameConverterPass;
  23. use ApiPlatform\Symfony\Bundle\DependencyInjection\Compiler\TestClientPass;
  24. use Symfony\Component\DependencyInjection\Compiler\PassConfig;
  25. use Symfony\Component\DependencyInjection\ContainerBuilder;
  26. use Symfony\Component\HttpKernel\Bundle\Bundle;
  27. /**
  28.  * The Symfony bundle.
  29.  *
  30.  * @author Kévin Dunglas <dunglas@gmail.com>
  31.  */
  32. final class ApiPlatformBundle extends Bundle
  33. {
  34.     /**
  35.      * {@inheritdoc}
  36.      */
  37.     public function build(ContainerBuilder $container)
  38.     {
  39.         parent::build($container);
  40.         $container->addCompilerPass(new DataProviderPass());
  41.         // Run the compiler pass before the {@see ResolveInstanceofConditionalsPass} to allow autoconfiguration of generated filter definitions.
  42.         $container->addCompilerPass(new AnnotationFilterPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION101);
  43.         $container->addCompilerPass(new FilterPass());
  44.         $container->addCompilerPass(new ElasticsearchClientPass());
  45.         $container->addCompilerPass(new GraphQlTypePass());
  46.         $container->addCompilerPass(new GraphQlQueryResolverPass());
  47.         $container->addCompilerPass(new GraphQlMutationResolverPass());
  48.         $container->addCompilerPass(new DeprecateMercurePublisherPass());
  49.         $container->addCompilerPass(new MetadataAwareNameConverterPass());
  50.         $container->addCompilerPass(new TestClientPass());
  51.         $container->addCompilerPass(new AuthenticatorManagerPass());
  52.         $container->addCompilerPass(new DeprecateLegacyIriConverterPass());
  53.     }
  54. }
  55. class_alias(ApiPlatformBundle::class, \ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle::class);