GuzzleMiddlewarePass.php 550 B

12345678910111213141516171819
  1. <?php
  2. namespace Drupal\Core\DependencyInjection\Compiler;
  3. use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
  4. use Symfony\Component\DependencyInjection\ContainerBuilder;
  5. class GuzzleMiddlewarePass implements CompilerPassInterface {
  6. /**
  7. * {@inheritdoc}
  8. */
  9. public function process(ContainerBuilder $container) {
  10. $middleware_ids = array_keys($container->findTaggedServiceIds('http_client_middleware'));
  11. $container->getDefinition('http_handler_stack_configurator')
  12. ->addArgument($middleware_ids);
  13. }
  14. }