From 4aebc6e3b7bfbf71679f5e1b32a91b7636af8180 Mon Sep 17 00:00:00 2001 From: Franck DAKIA Date: Thu, 23 Jan 2025 13:22:08 +0000 Subject: [PATCH] refact: change method name --- src/Http/Response.php | 6 ++++-- src/Support/helpers.php | 8 ++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Http/Response.php b/src/Http/Response.php index 5ccc6362..f5545a6a 100644 --- a/src/Http/Response.php +++ b/src/Http/Response.php @@ -4,9 +4,11 @@ namespace Bow\Http; -use Bow\Contracts\ResponseInterface; -use Bow\View\View; use stdClass; +use Bow\View\View; +use Bow\Http\HttpStatus; +use Bow\Http\ServerAccessControl; +use Bow\Contracts\ResponseInterface; class Response implements ResponseInterface { diff --git a/src/Support/helpers.php b/src/Support/helpers.php index ad3a5656..ebca869d 100644 --- a/src/Support/helpers.php +++ b/src/Support/helpers.php @@ -466,7 +466,7 @@ function csrf_time_is_expired(string $time = null): bool } } -if (!function_exists('json')) { +if (!function_exists('response_json')) { /** * Make json response * @@ -475,13 +475,13 @@ function csrf_time_is_expired(string $time = null): bool * @param array $headers * @return string */ - function json(array|object $data, int $code = 200, array $headers = []): string + function response_json(array|object $data, int $code = 200, array $headers = []): string { return response()->json($data, $code, $headers); } } -if (!function_exists('download')) { +if (!function_exists('response_download')) { /** * Download file * @@ -490,7 +490,7 @@ function json(array|object $data, int $code = 200, array $headers = []): string * @param array $headers * @return string */ - function download(string $file, ?string $filename = null, array $headers = []): string + function response_download(string $file, ?string $filename = null, array $headers = []): string { return response()->download($file, $filename, $headers); }