src/Leevel/Cache/Load.php
protected function update(string $name, array $option = [])
    {
        $sourceName = $name;

        list($name, $params) = $this->parse($name);

        if (false !== strpos($name, '@')) {
            list($name, $method) = explode('@', $name);
        } else {
            $method = 'handle';
        }

        if (!is_object($cache = $this->container->make($name))) {
            throw new InvalidArgumentException(sprintf('Cache %s is not valid.', $name));
        }

        if (!is_callable([$cache, $method])) {
            throw new InvalidArgumentException(
                sprintf('Cache %s is not a callable.', $name.'@'.$method)
            );
        }

        $sourceData = $cache->{$method}(...$params);

        $this->setPersistence($sourceName, $sourceData, $option);

        return $sourceData;
    }
protected function update(string $name, array $option = [])
    {
        $sourceName = $name;

        list($name, $params) = $this->parse($name);

        if (false !== strpos($name, '@')) {
            list($name, $method) = explode('@', $name);
        } else {
            $method = 'handle';
        }

        if (!is_object($cache = $this->container->make($name))) {
            throw new InvalidArgumentException(sprintf('Cache %s is not valid.', $name));
        }

        if (!is_callable([$cache, $method])) {
            throw new InvalidArgumentException(
                sprintf('Cache %s is not a callable.', $name.'@'.$method)
            );
        }

        $sourceData = $cache->{$method}(...$params);

        $this->setPersistence($sourceName, $sourceData, $option);

        return $sourceData;
    }
更新缓存数据.

@param string $name
@param array  $option

@return mixed