private function configureAutoDiscoveryClients(ContainerBuilder $container, array $config)
    {
        $httpClient = $config['discovery']['client'];
        if ('auto' !== $httpClient) {
            $container->removeDefinition('httplug.auto_discovery.auto_discovered_client');
            $container->removeDefinition('httplug.collector.auto_discovered_client');

            if (!empty($httpClient)) {
                $container->setAlias('httplug.auto_discovery.auto_discovered_client', $httpClient);
                $container->getAlias('httplug.auto_discovery.auto_discovered_client')->setPublic(false);
            }
        }

        $asyncHttpClient = $config['discovery']['async_client'];
        if ('auto' !== $asyncHttpClient) {
            $container->removeDefinition('httplug.auto_discovery.auto_discovered_async');
            $container->removeDefinition('httplug.collector.auto_discovered_async');

            if (!empty($asyncHttpClient)) {
                $container->setAlias('httplug.auto_discovery.auto_discovered_async', $asyncHttpClient);
                $container->getAlias('httplug.auto_discovery.auto_discovered_async')->setPublic(false);
            }
        }

        if (null === $httpClient && null === $asyncHttpClient) {
            $container->removeDefinition('httplug.strategy');

            return;
        }
    }
private function configureAutoDiscoveryClients(ContainerBuilder $container, array $config)
    {
        $httpClient = $config['discovery']['client'];
        if ('auto' !== $httpClient) {
            $container->removeDefinition('httplug.auto_discovery.auto_discovered_client');
            $container->removeDefinition('httplug.collector.auto_discovered_client');

            if (!empty($httpClient)) {
                $container->setAlias('httplug.auto_discovery.auto_discovered_client', $httpClient);
                $container->getAlias('httplug.auto_discovery.auto_discovered_client')->setPublic(false);
            }
        }

        $asyncHttpClient = $config['discovery']['async_client'];
        if ('auto' !== $asyncHttpClient) {
            $container->removeDefinition('httplug.auto_discovery.auto_discovered_async');
            $container->removeDefinition('httplug.collector.auto_discovered_async');

            if (!empty($asyncHttpClient)) {
                $container->setAlias('httplug.auto_discovery.auto_discovered_async', $asyncHttpClient);
                $container->getAlias('httplug.auto_discovery.auto_discovered_async')->setPublic(false);
            }
        }

        if (null === $httpClient && null === $asyncHttpClient) {
            $container->removeDefinition('httplug.strategy');

            return;
        }
    }
private function configureAutoDiscoveryClients ( ContainerBuilder $ container , array $ config ) { $ httpClient = $ config [ 'discovery' ] [ 'client' ] ; if ( 'auto' !== $ httpClient ) { $ container -> removeDefinition ( 'httplug.auto_discovery.auto_discovered_client' ) ; $ container -> removeDefinition ( 'httplug.collector.auto_discovered_client' ) ; if ( ! empty ( $ httpClient ) ) { $ container -> setAlias ( 'httplug.auto_discovery.auto_discovered_client' , $ httpClient ) ; $ container -> getAlias ( 'httplug.auto_discovery.auto_discovered_client' ) -> setPublic ( false ) ; } } $ asyncHttpClient = $ config [ 'discovery' ] [ 'async_client' ] ; if ( 'auto' !== $ asyncHttpClient ) { $ container -> removeDefinition ( 'httplug.auto_discovery.auto_discovered_async' ) ; $ container -> removeDefinition ( 'httplug.collector.auto_discovered_async' ) ; if ( ! empty ( $ asyncHttpClient ) ) { $ container -> setAlias ( 'httplug.auto_discovery.auto_discovered_async' , $ asyncHttpClient ) ; $ container -> getAlias ( 'httplug.auto_discovery.auto_discovered_async' ) -> setPublic ( false ) ; } } if ( null === $ httpClient && null === $ asyncHttpClient ) { $ container -> removeDefinition ( 'httplug.strategy' ) ; return ; } }
Make the user can select what client is used for auto discovery. If none is provided, a service will be created
by finding a client using auto discovery.

@param ContainerBuilder $container
@param array            $config
Make the user can select what client is used for auto discovery . If none is provided a service will be created by finding a client using auto discovery .