Skip to content

Commit 84a5edc

Browse files
committed
fix(ApiResponseContract): update json method parameter type
- Change the type of the 'status' parameter to accept bool, int, or string. - This allows for more flexibility in the response status representation. - Ensures compatibility with various status value types.
1 parent daa1aaa commit 84a5edc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Contracts/ApiResponseContract.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,11 @@ public function exception(\Throwable $throwable): JsonResponse;
2828
* @param int<100, 599>|int<100000, 599999> $code
2929
* @param null|array<string, mixed> $error
3030
*/
31-
public function json(bool $status, int $code, string $message = '', mixed $data = null, ?array $error = null): JsonResponse;
31+
public function json(
32+
bool|int|string $status,
33+
int $code,
34+
string $message = '',
35+
mixed $data = null,
36+
?array $error = null
37+
): JsonResponse;
3238
}

0 commit comments

Comments
 (0)