src/Leevel/Validate/Assert.php
public function flush(Closure $format = null): bool
    {
        if ($this->error) {
            if (!$format) {
                $format = 'json_encode';
            }

            $e = $format($this->error);

            throw new AssertException($e);
        }

        return true;
    }
public function flush(Closure $format = null): bool
    {
        if ($this->error) {
            if (!$format) {
                $format = 'json_encode';
            }

            $e = $format($this->error);

            throw new AssertException($e);
        }

        return true;
    }
释放并抛出验证

@param null|\Closure $format

@return bool