vendor/php-http/httplug-bundle/src/Discovery/ConfiguredClientsStrategyListener.php line 18

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace Http\HttplugBundle\Discovery;
  4. use Http\Discovery\HttpClientDiscovery;
  5. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  6. /**
  7.  * @author Wouter de Jong <wouter@wouterj.nl>
  8.  */
  9. class ConfiguredClientsStrategyListener implements EventSubscriberInterface
  10. {
  11.     /**
  12.      * Make sure to use the custom strategy.
  13.      */
  14.     public function onEvent()
  15.     {
  16.         HttpClientDiscovery::prependStrategy(ConfiguredClientsStrategy::class);
  17.     }
  18.     /**
  19.      * Whenever these events occur we make sure to add the custom strategy to the discovery.
  20.      *
  21.      * {@inheritdoc}
  22.      */
  23.     public static function getSubscribedEvents(): array
  24.     {
  25.         return [
  26.             'kernel.request' => ['onEvent'1024],
  27.             'console.command' => ['onEvent'1024],
  28.         ];
  29.     }
  30. }