@param array $provider

@throws ProviderException
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);
            }
        }
    }
100543
public function getProviderQueries(string $provider): array
    {
        return array_filter($this->data['queries'], function ($data) use ($provider) {
            return $data['providerName'] === $provider;
        });
    }
678143
public function removeProvider(Provider $provider)
    {
        $index = array_search($provider, $this->providers);

        if ($index !== false) {
            unset($this->providers[$index]);
        }

        return $this;
    }
251496
private function ensureServiceProvider(string $providerClass)
    {
        if (!is_subclass_of($providerClass, AbstractServiceProvider::class)) {
            throw new InvalidArgumentException(
                sprintf('Class "%s" must be a subclass of "%s".', $providerClass, AbstractServiceProvider::class)
            );
        }
    }
295715
protected function listen(DataProvider $provider)
    {
        Event::listen(
            DataProvider::EVENT_FETCH_ROW,
            function (DataRow $row, DataProvider $currentProvider) use ($provider) {
                if ($currentProvider !== $provider) return;
                $this->rows_processed++;
                foreach ($this->fields as $field) {
                    $name = $field->getName();
                    $operation = $this->getFieldOperation($name);
                    switch($operation) {

                        case self::OPERATION_SUM:
                            $this->src[$name] += $row->getCellValue($field);
                            break;
                        case self::OPERATION_COUNT:
                            $this->src[$name] = $this->rows_processed;
                            break;
                        case self::OPERATION_AVG:
                            $key = "{$name}_sum";
                            if (empty($this->src[$key])) {
                                $this->src[$key] = 0;
                            }
                            $this->src[$key] += $row->getCellValue($field);
                            $this->src[$name] = round(
                                $this->src[$key] / $this->rows_processed,
                                2
                            );
                            break;
                        default:
                            throw new LogicException(
                                'TotalsRow: Unknown aggregation operation.'
                            );
                    }

                }

            }
        );
    }
701662
public function addProvider($provider)
    {
        if (is_string($provider)) {
            $provider = new $provider($this);
        }

        // Only allow a service provider to be registered
        // once.
        if (in_array($provider, $this->providers)) {
            return;
        }

        $this->providers[] = $provider;

        $this->registerEvents($provider);
        $this->registerProvides($provider);

        $this->registerProvider($provider);
    }
895976
public function compileManifest(array $providers)
    {
        /*
         * The service manifest should contain a list of all of the providers for
         * the application so we can compare it on each request to the service
         * and determine if the manifest should be recompiled or is current.
         */
        $manifest = $this->freshManifest($providers);

        foreach ($providers as $provider) {
            $instance = $this->createProvider($provider);

            /*
             * When recompiling the service manifest, we will spin through each of the
             * providers and check if it's a deferred provider or not. If so we'll
             * add it's provided services to the manifest and note the provider.
             */
            if ($instance->isDeferred()) {
                foreach ($instance->provides() as $service) {
                    $manifest['deferred'][$service] = $provider;
                }

                $manifest['when'][$provider] = $instance->when();
            } else {
                /*
                 * If the service providers are not deferred, we will simply add it to an
                 * array of eagerly loaded providers that will get registered on every
                 * request to this application instead of "lazy" loading every time.
                 */
                $manifest['eager'][] = $provider;
            }
        }

        return $this->writeManifest($manifest);
    }
760337
public function registerProvider(Provider $provider): self
    {
        $this->providers[$provider->getName()] = $provider;

        return $this;
    }
692592
protected function loadEagerServiceProvider($provider, array $options)
    {
        if (!$options['eager']) {
            return;
        }

        $instance = Arr::get($options, 'instance', $provider);

        $this->app->register($instance);
    }
885305
public function registerProvider(ProviderInterface $provider, $lifeTime = 3600)
    {
        if (!$lifeTime instanceof \DateInterval) {
            $lifeTime = new \DateInterval(sprintf('PT%dS', $lifeTime));
        }

        $this->providers[$provider->getName()] = array('provider' => $provider, 'lifeTime' => $lifeTime);
    }
115481
public function registerProvider(Provider $provider)
    {
        $provider->register($this);
        
        $this->container->addProvider($provider);
        
        return $this;
    }
1147217
public static void addProvider(Class<? extends ContextProvider> provider) {

		Class clazz = (Class) ClassFactory.getGenericType(provider);
		addProvider(clazz, provider);
	}
428675
public function setMasterKeyPairProvider($provider)
    {
        if (isset($this->masterKeyPairProvider)) {
            throw new InvalidCallException('Setting read-only property: ' . get_class($this) . '::masterKeyPairProvider');
        }
        if (is_array($provider)) {
            $provider = Yii::createObject($provider);
        }

        $this->masterKeyPairProvider = $provider;
    }
1185038
private function handleProviderCallback($provider)
    {
        $providerUser = $this->socialite->driver($provider)->user();

        return $this->findOrCreateUser($providerUser);
     }
574223
public function withErrors($provider)
	{
		if ($provider instanceof MessageProviderInterface)
		{
			$this->with('errors', $provider->getMessageBag());
		}
		else
		{
			$this->with('errors', new MessageBag((array) $provider));
		}

		return $this;
	}
506344
private function setProviders($providers) {
        foreach ($providers as $key => $value) {
            $this->provides[] = $value;
            $this->app->appProviders[] = [$key=>$value];
        }
    }
1170017
public function toProvider(string $provider)
    {
        if (! class_exists($provider)) {
            throw new NotFound($provider);
        }
        if (! (new \ReflectionClass($provider))->implementsInterface(ProviderInterface::class)) {
            throw new InvalidProvider($provider);
        }
    }