Skip to content

Commit

Permalink
update: function comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jiannei committed Oct 13, 2023
1 parent 6014ad0 commit dbe3eaf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Support/Facades/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@
* @method static JsonResponse accepted($data = null, string $message = '', string $location = '')
* @method static JsonResponse created($data = null, string $message = '', string $location = '')
* @method static JsonResponse noContent(string $message = '')
* @method static JsonResponse localize(int|\BackedEnum $code = 200, array $headers = [], int $option = 0)
* @method static JsonResponse ok(string $message = '', int|\BackedEnum $code = 200, array $headers = [], int $option = 0)
* @method static JsonResponse success($data = null, string $message = '', int|\BackedEnum $code = 200, array $headers = [], int $option = 0)
* @method static JsonResponse localize(int|\BackedEnum $code = 200)
* @method static JsonResponse ok(string $message = '', int|\BackedEnum $code = 200)
* @method static JsonResponse success($data = null, string $message = '', int|\BackedEnum $code = 200)
* @method static void errorBadRequest(?string $message = '')
* @method static void errorUnauthorized(string $message = '')
* @method static void errorForbidden(string $message = '')
* @method static void errorNotFound(string $message = '')
* @method static void errorMethodNotAllowed(string $message = '')
* @method static void errorInternal(string $message = '')
* @method static JsonResponse fail(string $message = '', int|\BackedEnum $code = 500, $errors = null, array $header = [], int $options = 0)
* @method static JsonResponse fail(string $message = '', int|\BackedEnum $code = 500, $errors = null)
*
* @see \Jiannei\Response\Laravel\Response
*/
Expand Down
6 changes: 6 additions & 0 deletions src/Support/Format.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ public function response(): JsonResponse
return new JsonResponse($this->data, $this->statusCode);
}

/**
* Core format.
*
* @param $data
* @return array|$this
*/
public function data($data = null): static|array
{
if (is_null($data)) {
Expand Down

0 comments on commit dbe3eaf

Please sign in to comment.