public function addRule($name, callable $rule)
    {
        if (isset($this[self::rule($name)])) {
            throw new \RuntimeException("rule '$name' already exists'");
        }
        $this[self::rule($name)] = $this->protect($rule);
    }