public function select(string $type = null)
    {
        if (empty($type)) {
            $type = $this->provider;
        }

        $providers = $this->mergeProviders();
        if (!isset($providers[$type])) {
            throw new InvalidArgumentException(sprintf('Provider %s does not exist', $type));
        }

        $providerBeanName = $providers[$type];

        return App::getBean($providerBeanName);
    }
public function select(string $type = null)
    {
        if (empty($type)) {
            $type = $this->provider;
        }

        $providers = $this->mergeProviders();
        if (!isset($providers[$type])) {
            throw new InvalidArgumentException(sprintf('Provider %s does not exist', $type));
        }

        $providerBeanName = $providers[$type];

        return App::getBean($providerBeanName);
    }
public function select ( string $ type = null ) { if ( empty ( $ type ) ) { $ type = $ this -> provider ; } $ providers = $ this -> mergeProviders ( ) ; if ( ! isset ( $ providers [ $ type ] ) ) { throw new InvalidArgumentException ( sprintf ( 'Provider %s does not exist' , $ type ) ) ; } $ providerBeanName = $ providers [ $ type ] ; return App :: getBean ( $ providerBeanName ) ; }
Select a provider by Selector

@param string $type
@return ProviderInterface
@throws \Swoft\Exception\InvalidArgumentException
Select a provider by Selector