src/Leevel/Router/ResponseFactory.php
public function apiError(string $message, int $statusCode, ?string $text = null): ApiResponse
    {
        return $this->createApiResponse()->error($message, $statusCode, $text);
    }
public function apiError(string $message, int $statusCode, ?string $text = null): ApiResponse
    {
        return $this->createApiResponse()->error($message, $statusCode, $text);
    }
错误请求

@param string $message
@param int    $statusCode
@param string $text

@return \Leevel\Http\ApiResponse