private static function getProvider($query, array $providers, Provider $currentProvider = null): Provider
    {
        if (null !== $currentProvider) {
            return $currentProvider;
        }

        if (0 === count($providers)) {
            throw ProviderNotRegistered::noProviderRegistered();
        }

        // Take first
        $key = key($providers);

        return $providers[$key];
    }
private static function getProvider($query, array $providers, Provider $currentProvider = null): Provider
    {
        if (null !== $currentProvider) {
            return $currentProvider;
        }

        if (0 === count($providers)) {
            throw ProviderNotRegistered::noProviderRegistered();
        }

        // Take first
        $key = key($providers);

        return $providers[$key];
    }
private static function getProvider ( $ query , array $ providers , Provider $ currentProvider = null ) : Provider { if ( null !== $ currentProvider ) { return $ currentProvider ; } if ( 0 === count ( $ providers ) ) { throw ProviderNotRegistered :: noProviderRegistered ( ) ; } // Take first $ key = key ( $ providers ) ; return $ providers [ $ key ] ; }
Get a provider to use for this query.

@param GeocodeQuery|ReverseQuery $query
@param Provider[]                $providers
@param Provider                  $currentProvider

@return Provider

@throws ProviderNotRegistered
Get a provider to use for this query .