diff --git a/src/Support/Format.php b/src/Support/Format.php index 2d0ed5f..f6a7616 100644 --- a/src/Support/Format.php +++ b/src/Support/Format.php @@ -78,7 +78,7 @@ public function data(mixed $data = null, string $message = '', int|\BackedEnum $ 'error' => $this->formatError($error), ]); - $this->statusCode = $this->formatStatusCode($bizCode, $error); + $this->statusCode = $this->formatStatusCode($bizCode); }); } @@ -165,9 +165,9 @@ protected function formatStatus(int $bizCode): string /** * Http status code. */ - protected function formatStatusCode(int $code, $errors): int + protected function formatStatusCode(int $code): int { - return (int) substr(is_null($errors) ? (Config::get('response.error_code') ?: $code) : $code, 0, 3); + return (int) substr(Config::get('response.error_code') ?: $code, 0, 3); } /**