自增缓存（针对数值缓存）
@access public
@param  string $name 缓存变量名
@param  int    $step 步长
@return false|int
514192
public function inc(string $name, int $step = 1)
    {
        $this->writeTimes++;

        $key = $this->getCacheKey($name);

        if ($this->handler->get($key)) {
            return $this->handler->increment($key, $step);
        }

        return $this->handler->set($key, $step);
    }
1352930
public function dec(string $name, int $step = 1)
    {
        $this->writeTimes++;

        $key   = $this->getCacheKey($name);
        $value = $this->handler->get($key) - $step;
        $res   = $this->handler->set($key, $value);

        return !$res ? false : $value;
    }
986466
public function increment($key, $step = 1)
    {
        $connection = $this->getConnection($key);
        $this->writeToRemote(array(
            'cmd' => 'increment',
            'key' => $key,
            'step' => $step,
        ), $connection);
        return $this->readFromRemote($connection);
    }
1066703
public function inc($key, $step = 1) {
        $key = $this->conf['keyPrefix'] . $key;
        X::logger()->trace("MCache inc $key by $step");
        return $this->cache->increment($key, $step);
    }
323439
public function decrement($key, $step)
    {
        $value = $this->getValueByKey($key, false);
        $this->alter($key, $value - $step);
    }
671221
public static function inc($key, $step = 1) {
        try {
            self::getCache()->inc($key, $step);
            self::release();
        } catch (\RuntimeException $e) {
            self::release();
            throw $e;
        } catch (\Error $e) {
            self::release();
            throw $e;
        }
    }
819772
public function deserialize($data, Step $step = null, array $options = [])
    {
        $step = $step ?: new Step();

        $this->sipe('id', 'setUuid', $data, $step);
        $this->sipe('title', 'setTitle', $data, $step);
        $this->sipe('description', 'setDescription', $data, $step);

        if (in_array(Transfer::REFRESH_UUID, $options)) {
            $step->refreshUuid();
        }

        if (!empty($data['parameters'])) {
            $this->deserializeParameters($step, $data['parameters']);
        }

        if (!empty($data['picking'])) {
            $this->deserializePicking($step, $data['picking']);
        }

        if (!empty($data['items'])) {
            $this->deserializeItems($step, $data['items'], $options);
        }

        return $step;
    }
1032623
public function inc(string $name, int $step = 1)
    {
        $this->writeTimes++;

        $key = $this->getCacheKey($name);

        return wincache_ucache_inc($key, $step);
    }
1030292
public function inc(string $name, int $step = 1)
    {
        $this->writeTimes++;

        $key = $this->getCacheKey($name);

        return $this->handler->incrby($key, $step);
    }
349420
public function getStep($stepName)
    {
        if (!$this->getSteps()->offsetExists($stepName)) {
            throw new WorkflowException('Step with name "'.$stepName.'" is not in "'.$this->workflowName.'" workflow');
        }

        return $this->getSteps()->offsetGet($stepName);
    }
598463
public function getValueFromOtherStep($fromStep, $key)
    {
        // load the steps in the cache, if this one doesn't exist
        if (!array_key_exists('steps_' . $fromStep, $this->step_data_cache)) {
            $steps = self::get()->filter('SessionID', $this->form->session->ID);

            if ($steps) {
                foreach ($steps as $step) {
                    $this->step_data_cache['steps_' . $step->ClassName] = $step->loadData();
                }
            }
        }

        // check both as PHP isn't recursive
        if (isset($this->step_data_cache['steps_' . $fromStep])) {
            if (isset($this->step_data_cache['steps_' . $fromStep][$key])) {
                return $this->step_data_cache['steps_' . $fromStep][$key];
            }
        }

        return null;
    }
318840
public function get_last_step_with_qt_var($name) {
        foreach ($this->get_reverse_step_iterator() as $step) {
            if ($step->has_qt_var($name)) {
                return $step;
            }
        }
        return new question_attempt_step_read_only();
    }
692938
public function removeStep(Step $step)
    {
        if ($this->steps->contains($step)) {
            $this->steps->removeElement($step);
        }

        return $this;
    }
300725
public function addStep($name, $callback)
    {
        $step = $this->factory([
            'Step',
            'wizard'  => $this,
            'template'=> clone $this->stepTemplate,
            'sequence'=> count($this->steps),
        ], $name);

        // add tabs menu item
        $this->steps[] = $this->add($step, 'Step');

        if (!$this->stepCallback->triggered()) {
            $_GET[$this->stepCallback->urlTrigger] = 0;
        }

        if ($step->sequence == $this->currentStep) {
            $step->addClass('active');

            $this->stepCallback->set($callback, [$this]);
        } elseif ($step->sequence < $this->currentStep) {
            $step->addClass('completed');
        }

        if ($step->icon == null) {
            $step->icon = $this->defaultIcon;
        }

        return $step;
    }
792627
private function validateAndNormalizeStep(string $name, $step): array
    {
        static $depth = 0;
        if (!is_array($step)) {
            if (is_string($step) && class_exists($step)) {
                $step = [
                    'class' => $step,
                ];
            } elseif (is_callable($step)) {
                $step = [
                    'callable' => $step,
                ];
            } else {
                $step = [
                    'command' => $step,
                ];
            }
        } else {
            $numMatchedStepTypes = count(array_intersect(['class', 'command', 'callable', 'steps'], array_keys($step)));
            if (0 == $numMatchedStepTypes) {
                if (0 == $depth) {
                    $depth++;
                    // Assume this is an array of commands to be run in parallel
                    $parallelSteps = [];
                    foreach ($step as $parallelName => $parallelStep) {
                        [$parallelName, $parallelStep] = $this->validateAndNormalizeStep(
                            $parallelName,
                            $parallelStep
                        );
                        if (!is_null($parallelName)) {
                            $parallelSteps[$parallelName] = $parallelStep;
                        } else {
                            $parallelSteps[] = $parallelStep;
                        }
                    }
                    $step = [
                        'steps' => $parallelSteps,
                    ];
                    $depth--;
                } else {
                    // Do not allow multiple levels of steps
                    throw new Exception\RuntimeException(
                        'Step "' . $name . '" must include one of the keys "class", "callable", or "command".'
                    );
                }
            } elseif ($numMatchedStepTypes > 1) {
                throw new Exception\RuntimeException(
                    'Step "' . $name
                    . '" may only include one of the keys "class", "callable", "command", or "steps".'
                );
            }
        }

        // @todo Maybe remove this if we move to Yaml config
        if (!empty($step['callable']) && !is_string($step['callable'])) {
            throw new Exception\RuntimeException(
                'Step "' . $name . '" may not be defined as a closure since it cannot be cached. Create a '
                . 'class with a static method instead and define this step as MyClass::myMethod'
            );
        }

        if (!empty($step['class']) && !in_array($this->stepInterface, class_implements($step['class']))) {
            throw new Exception\RuntimeException(
                'Step "' . $name . '" class must implement ' . $this->stepInterface . '.'
            );
        }


        // @todo Should we force a name to be set instead?
        if (empty($name) || is_numeric($name)) {
            // @todo Need unique ID for steps without a name or does null work?
            $name = $step['class'] ?? $step['command'] ?? $step['callable'] ?? null;
        }

        return [$name, $step];
    }
434928
public function next($step = 1)
    {
        return $this->siblings(
            array_search($this, $this->parent->filters(), true) + $step
        );
    }
428202
public function addStep(Step $step)
    {
        if (!$this->steps->contains($step)) {
            $this->steps->add($step);
        }

        return $this;
    }