注册服务.
@param ServiceProviderInterface $provider 实例.
@param array $items 配置.
@return self
170545
public function register(
        ServiceProviderInterface $provider,
        array $items = []
    ): self {
        $provider->register($this);
        foreach ($items as $key => $value) {
            $this[$key] = $value;
        }
        return $this;
    }
134462
public function importProvider(ResourceProviderInterface $provider, array $values = [])
    {
        $provider->populate($this);
        $this->importValues($values);
    }
506344
private function setProviders($providers) {
        foreach ($providers as $key => $value) {
            $this->provides[] = $value;
            $this->app->appProviders[] = [$key=>$value];
        }
    }
1292136
public function replace(array $items): parent {
        $ac = new ArrayCover($this->_data);
        $this->_data = $ac($items);
        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);
            }
        }
    }
514172
public function setProviders($providers)
    {
        $this->guardForArrayOrTraversable($providers);

        foreach ($providers as $provider) {
            $this->addProvider($provider);
        }
    }
639175
protected function fromProvider($provider)
    {
        $provider = IOC::resolve($provider);
        $module = $provider->create();
        $this->add($provider->getName(), $module);
        return $module;
    }
1058453
public function items(array $items)
    {
        foreach ($items as $uri => $title) {
            list($title, $uri, $liAttr) = $this->fixData($uri, $title);
            $this->item($title, $uri, $liAttr);
        }
        return $this;
    }
763255
protected static function formItems($provider, $array)
    {
        $set = [];

        foreach ($array['items'] as $params) {
            $instance = new static($provider, array_merge($params, ['exists' => true]));
            $instance->cacheFields($params);
            if (isset($instance->id)) {
                $set[$instance->id] = $instance;
            } else {
                $set[] = $instance;
            }
        }

        return $set;
    }
46150
protected function registerEvents(ServiceProvider $provider)
    {
        if ( ! isset($this->event)) return;

        foreach ($provider->when() as $event) {
            $this->event->listen($event, function() use ($provider) {
                $this->registerProvider($provider, true);
            });
        }
    }
1142610
public function setItems($items) {

      if (!is_array($items)) {
        throw new \InvalidArgumentException('You can set only array of items');
      }

      $this->items = $items;
      $this->rewind();
      return $this;
    }
218641
public function setItems(array $items)
    {
        $items = $this->getArrayableItems($items);

        foreach ($items as $item) {
            //Ensure the correct type is provided
            $this->checkType($item);
        }

        $this->items = $items;

        return $this;
    }
21588
public static function create(ProviderInterface $provider, array $config)
    {
        return OAuth1Factory::create(
            array_merge($provider->getUriConfig(), $config),
            $provider->getSigner()
        );
    }
238285
public function setItems($items)
    {
        if (! is_array($items)) {
            $items = func_get_args();
        }

        $this->addBody($items);

        return $this;
    }
1033618
public function order($items)
	{
		$this->emptyResult();

		empty($items) ? $this->queryBuilder->order(NULL) : $this->queryBuilder->addOrder(func_get_args());
		return $this;
	}
958369
public function addRuleProvider(RuleProvider $provider)
    {
        $this->loaded && $this->loaded->__invoke();

        $this->ruleProviders[] = $provider;

        return $this;
    }
140494
public function persistence($provider, array $params = array())
    {
        $this->persistence = array_merge(array(Config::PROVIDER => $provider), array(Config::PARAMS => $params));

        return $this;
    }