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

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