src/Leevel/Validate/Validator.php
protected function callExtend(string $rule, array $parameter): bool
    {
        $extends = $this->extends[$rule];

        if (is_callable($extends)) {
            $parameter[] = $this;

            return $extends(...$parameter);
        }

        if (is_string($extends)) {
            return $this->callClassExtend($extends, $parameter);
        }

        $e = sprintf('Extend in rule %s is not valid.', $rule);

        throw new InvalidArgumentException($e);
    }
protected function callExtend(string $rule, array $parameter): bool
    {
        $extends = $this->extends[$rule];

        if (is_callable($extends)) {
            $parameter[] = $this;

            return $extends(...$parameter);
        }

        if (is_string($extends)) {
            return $this->callClassExtend($extends, $parameter);
        }

        $e = sprintf('Extend in rule %s is not valid.', $rule);

        throw new InvalidArgumentException($e);
    }
调用自定义验证器.

@param string $rule
@param array  $parameter

@return bool