Sets the provider to use.

@param  string                        $name A provider's name
@return \SmsSender\SmsSenderInterface
357851
public function using($name)
    {
        if (isset($this->providers[$name])) {
            $this->provider = $this->providers[$name];
        }

        return $this;
    }
1264641
public function domain($name = 'default')
    {
        if (!isset($this->domains[$name]))
        {
            $slice = $this->slice->getSlice($name);
            $class = $this->provider;

            $this->domains[$name] = new $class($this, $slice, $name);
        }

        return $this->domains[$name];
    }
4542
protected function setProvider($name, ThemeProviderInterface $provider) {
        $k = ObjectHelper::getShortName($name);
        $v = $this->getIndex()[$k];
        if (null !== $v) {
            $this->getProviders()[$v] = $provider;
            return $this;
        }
        $this->index[$k] = count($this->getProviders());
        return $this->addProvider($provider);
    }
893541
protected function resolve( $name )
	{
		$config = $this->getConfig( $name );

		if ( is_null( $config ) )
			throw new InvalidArgumentException( "Password resetter [{$name}] is not defined." );

		// The password broker uses a token repository to validate tokens and send user
		// password e-mails, as well as validating that password reset process as an
		// aggregate service of sorts providing a convenient interface for resets.
		return new PasswordBroker( $this->createTokenRepository( $config ), AccountManager::i()->resolveAuth( $config['provider'] ), Mailer::i(), $config['email'] );
	}
570699
public function dataProvider(string $name): DataProviderInterface
    {
        if (isset($this->dataProviders[$name])) {
            return $this->dataProviders[$name];
        }
        throw new \InvalidArgumentException(sprintf(
            "Requested data provider '%s' could not be found; does the content type exist, or provider not specified?",
            $name
        ));
    }
143977
public function getProvider($name)
    {
        if (!isset($this->providers[$name])) {
            throw new \InvalidArgumentException(sprintf(
                'Unknown provider "%s", registered reindex providers: "%s"',
                $name, implode('", "', array_keys($this->providers))
            ));
        }

        return $this->providers[$name];
    }
468590
public function setName($name) : self
    {
        if (null === $name || (!is_string($name) && !is_int($name))) {
            throw new \InvalidArgumentException('name must be either an integer or a string.');
        }

        $this->name = $name;

        return $this;
    }
791015
public function setName( $name )
   {

      if ( $this->_name === $name ) { return $this; }

      $this->_name = $name;

      $this->notify( [ 'property' => 'name' ] );

      return $this;

   }
183809
public function setGivenName($name)
    {
        $this->set('givenName', $name);
        $this->set('name', $this->givenName.' '.$this->familyName);

        return $this;
    }
384861
protected function setUsername($name) {
        if (!is_string($name)) throw new IllegalTypeException('Illegal type of parameter $name: '.gettype($name));
        if (!strlen($name))    throw new InvalidArgumentException('Invalid parameter $name: "'.$name.'" (empty)');

        $this->username = $name;
        return $this;
    }
225785
private function resolve($name)
    {   
        // set as resolved
        $this->resolved[$name] = true;
        
        // resolve the service
        if (is_string($this->instances[$name]) && class_exists($this->instances[$name])) 
        {
            
            $object = $this->instances[$name];

            return new $object();

        }
        elseif(is_callable($this->instances[$name]))
        {

            $callable = $this->instances[$name];

            return $callable();

        }    

        return $this->instances[$name];
    }
261132
public function usingCredentials($name = null)
    {
        // Set credentials name.
        $this->getAccessManager()->setCredentialsName($name)->setCredentials($name);

        // Return this.
        return $this;
    }
978854
public function hasProvider($name)
    {
        if ($this->singletons->has($name)) {
            return $this->singletons->get($name);
        }
        if ($this->providers->has($name)) {
            return $this->providers->get($name);
        }
        $alias = basename(str_replace('\\', '/', $name));
        if ($this->singletons->has($alias)) {
            return $this->singletons->get($alias);
        }
        if ($this->providers->has($alias)) {
            return $this->providers->get($alias);
        }

        return null;
    }
788080
public function setFamilyName($name)
    {
        $this->set('familyName', $name);
        $this->set('name', $this->givenName.' '.$this->familyName);

        return $this;
    }
537807
public function setProvider($provider = null)
    {
        $this->provider = null;

        if (null === ($provider = $this->internalResolveProvider($provider))) {
            $this->provider = $this->providerId = null;
        } else {
            $this->providerId = $provider->id;
            $this->provider = $provider;
        }

        return $this;
    }
837436
public function setName($name)
    {
        if (!preg_match('/^' . self::REGEX_TAGNAME . '$/u', $name)) {
            throw new \InvalidArgumentException(
                'Invalid tag name supplied: ' . $name
            );
        }

        $this->tag = $name;

        return $this;
    }
766521
private function setName($name)
    {
        $name       = trim(strip_tags($name));
        $this->name = str_replace([' '], '-', $name);

        return $this;
    }