protected function buildProvider($providerDefinition): ServiceProviderInterface
    {
        if (\is_string($providerDefinition)) {
            $provider = $this->buildFromConfig(null, [
                '__class' => $providerDefinition,
                '__construct()' => [
                    $this,
                ]
            ]);
        } elseif (\is_array($providerDefinition) && isset($providerDefinition['__class'])) {
            $providerDefinition['__construct()'] = [
                $this
            ];
            $provider = $this->buildFromConfig(null, $providerDefinition);
        } else {
            throw new InvalidConfigException('Service provider definition should be a class name ' .
                'or array contains "__class" with a class name of provider.');
        }

        if (!($provider instanceof ServiceProviderInterface)) {
            throw new InvalidConfigException(
                'Service provider should be an instance of ' . ServiceProviderInterface::class
            );
        }

        return $provider;
    }
protected function buildProvider($providerDefinition): ServiceProviderInterface
    {
        if (\is_string($providerDefinition)) {
            $provider = $this->buildFromConfig(null, [
                '__class' => $providerDefinition,
                '__construct()' => [
                    $this,
                ]
            ]);
        } elseif (\is_array($providerDefinition) && isset($providerDefinition['__class'])) {
            $providerDefinition['__construct()'] = [
                $this
            ];
            $provider = $this->buildFromConfig(null, $providerDefinition);
        } else {
            throw new InvalidConfigException('Service provider definition should be a class name ' .
                'or array contains "__class" with a class name of provider.');
        }

        if (!($provider instanceof ServiceProviderInterface)) {
            throw new InvalidConfigException(
                'Service provider should be an instance of ' . ServiceProviderInterface::class
            );
        }

        return $provider;
    }
protected function buildProvider ( $ providerDefinition ) : ServiceProviderInterface { if ( \ is_string ( $ providerDefinition ) ) { $ provider = $ this -> buildFromConfig ( null , [ '__class' => $ providerDefinition , '__construct()' => [ $ this , ] ] ) ; } elseif ( \ is_array ( $ providerDefinition ) && isset ( $ providerDefinition [ '__class' ] ) ) { $ providerDefinition [ '__construct()' ] = [ $ this ] ; $ provider = $ this -> buildFromConfig ( null , $ providerDefinition ) ; } else { throw new InvalidConfigException ( 'Service provider definition should be a class name ' . 'or array contains "__class" with a class name of provider.' ) ; } if ( ! ( $ provider instanceof ServiceProviderInterface ) ) { throw new InvalidConfigException ( 'Service provider should be an instance of ' . ServiceProviderInterface :: class ) ; } return $ provider ; }
Builds service provider by definition.

@param string|array $providerDefinition class name or definition of provider.
@return ServiceProviderInterface instance of service provider;

@throws InvalidConfigException
@throws NotInstantiableException
Builds service provider by definition .