Get the registered service provider instance if it exists.

@param ServiceProvider|string $provider
@return ServiceProvider|null
17772
public function getProvider($provider)
    {
        $name = is_string($provider) ? $provider : get_class($provider);

        return Arr::first($this->serviceProviders, function ($key, $value) use ($name) {
            return $value instanceof $name;
        });
    }
999597
protected function bootProvider(ServiceProvider $provider)
    {
        parent::bootProvider($provider);

        if (method_exists($provider, 'booted')) {
            Event::listen('antares.extension: booted', function() use($provider) {
                Event::fire(new LoadServiceProviders());
                $this->call([$provider, 'booted']);
            });
        }
    }
318223
protected function validateProvider($provider) {
        if (is_string($provider)) {
            if ( ! class_exists($provider)) {
                $message = s('Provider class %s does not exist.', $provider);

                throw new InvalidProviderException($message);
            }
        } else if ( ! is_object($provider)) {
            $message = s(
                'Provider must be either a valid class name, or an instance, received: "%s".',
                get_type($provider)
            );

            throw new InvalidProviderException($message);
        }
    }
110103
public function getProvider($alias)
    {
        if (array_key_exists($alias, $this->providers)) {
            return $this->providers[$alias];
        }

        return null;
    }
1140866
protected function getConfigFromProvider( $provider){
        $service = sprintf( self::API_CONNECTION_DDNS_CONFIG, $provider);
        $rest = $this->getService( $service);
        $rest->GET();

        return $rest->getResult( models\Connection\DynDns\Config::class);
    }
85778
public function getProviders($provider)
    {
        $name = \is_string($provider) ? $provider : \get_class($provider);

        return Arr::where($this->loadedProviders, function ($value) use ($name) {
            return $value instanceof $name;
        });
    }
824785
public function getProvider($key) {
        if (!isset($this->providers[$key])) {
            return null;
        }
        
        return $this->providers[$key];
    }
677920
protected function resolveProvider($provider): ServiceProviderInterface
    {
        // If the given "provider" is a string, we will resolve it.
        // This is simply a more convenient way of specifying your service provider classes.
        if (is_string($provider) && class_exists($provider)) {
            $provider = new $provider();
        }

        // TODO : voir si on garder ce throw car de toute facon le typehint va lever une exception.
        if (! $provider instanceof ServiceProviderInterface) {
            throw new InvalidArgumentException(
                sprintf('The provider must be an instance of "%s" or a valid class name.',
                    ServiceProviderInterface::class)
            );
        }

        return $provider;
    }
284052
public function oauthSpec($provider)
	{
		$service = $this->service($provider);
		
		if (false !== stristr(get_class($service), 'OAuth1')) {
			return 1;
		}
		else if (false !== stristr(get_class($service), 'OAuth2')) {
			return 2;
		}
		
		return null;
	}
782324
private function getProvider()
    {
        $app = $this->app;
        $version = intval($app::VERSION);
        $provider = sprintf(
            '\Intervention\Validation\ValidationServiceProviderLaravel%d', $version
        );

        return new $provider($app);
    }
732223
public function add($provider)
    {
        if(is_object($provider) && $provider instanceof Provider)
            return $this->register($provider);

        if($this->lateRegistry == true)
        {
            $this->providers[$provider] = false;

            return $this;
        }

        if(method_exists($provider, 'provides') && is_array($dependencies = $provider::provides()) && count($dependencies) > 0)
            return $this->addDeferred($provider, $dependencies);

        $this->providers[$provider] = true;

        $this->register(new $provider);

        return $this;
    }
1112117
public function register(ServiceProviderInterface $provider, $settings = [])
    {
        $provider->register($this);
        foreach ($settings as $key => $value) {
            $this->set($key, $value);
        }

        return $this;
    }
112295
public function register($provider)
    {
        // Verificar se provider já foi registrado
        $keyProvider = is_string($provider) ? $provider : get_class($provider);
        if (array_key_exists($keyProvider, $this->serviceProviders)) {
            return $this->serviceProviders[$keyProvider];
        }

        // Carregar provider quando string
        if (is_string($provider)) {
            $provider = new $provider($this);
        }

        if (method_exists($provider, 'register')) {
            $provider->register();
        }

        // Marcar como registrado
        $this->serviceProviders[$keyProvider] = $provider;

        // Verificar se deve
        if ($this->booted) {
            $this->bootProvider($provider);
        }

        return $provider;
    }
167560
protected function getStatusFromProvider( $provider){
        $service = sprintf( self::API_CONNECTION_DDNS_STATUS, $provider);
        $rest = $this->getService( $service);
        $rest->GET();

        return $rest->getResult( models\Connection\DynDns\Status::class);
    }
874392
protected function recompileProvider(string $provider): array
    {
        $instance = $this->app->resolveProvider($provider);


        $type = $instance->isDeferred() ? 'Deferred' : 'Eager';

        return $this->{"register{$type}ServiceProvider"}($provider, $instance);
    }
1217174
def _get_service_provider(self):
        
        service_class = self._spec.get('service_class', None)
        if service_class is not None:
            warnings.warn(
                'The service_class key for a domain is deprecated, you should '
                'change it to service_provider instead'
            )
            service_provider = _resolve_service_class(
                class_name=service_class,
                service_providers=self.service_providers,
            )
        else:
            service_provider = self.service_providers.get(
                self._spec.get('service_provider', None),
                None,
            )

        return service_provider
128470
public function createUserProvider($provider = null)
    {
        if (is_null($config = $this->getProviderConfiguration($provider))) {
            return;
        }

        if (isset($this->customProviderCreators[$driver = ($config['driver'] ?? null)])) {
            return call_user_func(
                $this->customProviderCreators[$driver], $this->app, $config
            );
        }

        switch ($driver) {
            case 'database':
                return $this->createDatabaseProvider($config);
            case 'eloquent':
                return $this->createEloquentProvider($config);
            default:
                throw new InvalidArgumentException(
                    "Authentication user provider [{$driver}] is not defined."
                );
        }
    }