Adds a service provider.

@since  5.0.0
@access public
@param  string|object  $provider
@return void
515176
public function provider( $provider ) {

		if ( is_string( $provider ) ) {
			$provider = $this->resolveProvider( $provider );
		}

		$this->providers[] = $provider;
	}
870714
public function registerHelper($name, $provider)
    {
        $this->formatter->getDependencies()->register(
            $this->helperName($name),
            $provider
        );

        return $this;
    }
304147
@SuppressWarnings("unchecked")
	public <T> RestBuilder addProvider(Class<? extends ContextProvider<T>> provider) {

		Assert.notNull(provider, "Missing context provider!");
		registeredProviders.put(null, provider);
		return this;
	}
2089
private function resolveProviderAnnotation($provider)
    {
        if (is_array($provider)) {

            foreach ($provider as $item) {
                $this->resolveProviderAnnotation($item);
            }

        } else {
            if (false === $this->isProvided($provider)) {
                $this->addProvider($provider);
            }
        }
    }
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;
    }
618412
public function addProvider(PathProviderInterface $provider, $priority = 0)
    {
        $this->providers[$priority][] = $provider;
        $this->sorted                 = null;
    }
1175821
public function addProvider($name, ProviderInterface $provider)
    {
        if (!is_string($name) && empty($name)) {
            throw new InvalidArgumentException('Your provider name must be string and not empty.');
        }

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

        return $this;
    }
709282
def add(self, provider, front=False):
        
        if provider:
            i = self.provider_id_slot(provider)
            if i is not None:
                self.providers[i] = provider

            elif front:
                self.providers.insert(0, provider)

            else:
                self.providers.append(provider)
1138545
public function register($provider, $options = [], $force = false){
		if(!isset($this->providers[$provider]) || $force){
			$this->providers[$provider] = new $provider($this,$options);
			with($this->providers[$provider])->register();
		}
	}
951766
protected function registerServiceProviders( $service_providers, Container $container ) {
		foreach ( $service_providers as $provider ) {
			$provider->register( $container );
		}
	}
672472
public <T> RestBuilder addProvider(Class<T> clazz, Class<? extends ContextProvider<T>> provider) {

		Assert.notNull(clazz, "Missing provided class type!");
		Assert.notNull(provider, "Missing context provider!");
		registeredProviders.put(clazz, provider);
		return this;
	}
502831
public void registerProvider(Object provider) {
		if (provider != null) {
			Collection<Object> providerList = new ArrayList<>(1);
			providerList.add(provider);
			registerProviders(providerList);
		}
	}
1220224
public function addProvider(BlacklistProviderInterface $provider)
    {
        if ($provider === $this) {
            throw new \RuntimeException('Unable to add ChainProvider to itself.');
        }

        $this->providers[] = $provider;

        return $this;
    }
268333
protected function registerProvides(ServiceProvider $provider)
    {
        foreach ($provider->provides() as $binding) {
            $this->provides[$binding][] = $provider;
        }
    }
1237959
public function add(ProviderInterface $provider)
    {
        $container = $this->container;

        $this->container = $provider->register($container);

        $this->providers[] = (string) get_class($provider);

        return $this;
    }
789718
public function addProvider(ProviderInterface $provider)
    {
        if (array_key_exists($name = $provider->getName(), $this->providers)) {
            throw new \InvalidArgumentException("Wide search provider '{$name}' is already registered.");
        }

        $this->providers[$name] = $provider;
    }
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);
        }
    }