private function setupAutowire(array $config, ContainerBuilder $container)
    {
        if (!method_exists($container, 'autowire')) {
            // This container have no support for services auto-wiring
            return;
        }

        if (!$config['autowire']) {
            // Auto-wiring for default client is explicitly disabled
            return;
        }

        if (!array_key_exists('default', $config['clients'])) {
            // No "default" client is available
            return;
        }

        if ($container->hasDefinition(Client::class)) {
            throw new LogicException('Default Elasticsearch client autowiring setup is enabled, ' .
                'but Elastica client service is already defined in container');
        }

        $container->setAlias(Client::class, $this->createClientId('default'));
    }