Skip to content

Commit

Permalink
refact: change method name
Browse files Browse the repository at this point in the history
  • Loading branch information
papac committed Jan 23, 2025
1 parent 0650f51 commit 4aebc6e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions src/Http/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
8 changes: 4 additions & 4 deletions src/Support/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand All @@ -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
*
Expand All @@ -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);
}
Expand Down

0 comments on commit 4aebc6e

Please sign in to comment.