Skip to content

Commit

Permalink
updated enum types
Browse files Browse the repository at this point in the history
  • Loading branch information
dconco committed Aug 22, 2024
1 parent 9fdab4e commit d9342fa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/Status.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public function setMessage (mixed $message): void
* This PHP function handles errors by formatting the error data based on the response type and status
* code.
*
* @param array data The `data` parameter in the `error` function can accept either an array or a
* @param string|array data The `data` parameter in the `error` function can accept either an array or a
* string. It is used to provide the error message or data that needs to be returned in the response.
* @param int status The `status` parameter in the `error` function is an optional integer parameter
* that represents the HTTP status code to be returned in the response. If not provided, the default
Expand All @@ -192,7 +192,7 @@ public function setMessage (mixed $message): void
* the value of the `` property. The response can be in JSON, HTML, XML, CSV, or as a plain
* array.
*/
public function error (array|string $data, int $status = StatusCode::INTERNAL_SERVER_ERROR): string|array
public function error (string|array $data, int $status = StatusCode::INTERNAL_SERVER_ERROR): string|array
{
$data = [ 'error' => $data ];

Expand All @@ -215,7 +215,7 @@ public function error (array|string $data, int $status = StatusCode::INTERNAL_SE
* This PHP function returns a success response in various formats based on the specified response
* type.
*
* @param array data The `data` parameter in the `success` function can be either an array or a
* @param string|array data The `data` parameter in the `success` function can be either an array or a
* string. It is wrapped in an array with the key 'success' before being returned based on the
* response type specified.
* @param int status The `status` parameter in the `success` function represents the HTTP status code
Expand All @@ -229,7 +229,7 @@ public function error (array|string $data, int $status = StatusCode::INTERNAL_SE
* type. The specific response format returned depends on the value of `->response` which can be
* JSON, HTML, XML,
*/
public function success (array|string $data, int $status = StatusCode::OK): string|array
public function success (string|array $data, int $status = StatusCode::OK): string|array
{
$data = [ 'success' => $data ];

Expand Down
8 changes: 4 additions & 4 deletions src/interface/StatusInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public function setMessage (mixed $message): void;
* This PHP function handles errors by formatting the error data based on the response type and status
* code.
*
* @param array data The `data` parameter in the `error` function can accept either an array or a
* @param string|array data The `data` parameter in the `error` function can accept either an array or a
* string. It is used to provide the error message or data that needs to be returned in the response.
* @param int status The `status` parameter in the `error` function is an optional integer parameter
* that represents the HTTP status code to be returned in the response. If not provided, the default
Expand All @@ -120,13 +120,13 @@ public function setMessage (mixed $message): void;
* the value of the `` property. The response can be in JSON, HTML, XML, CSV, or as a plain
* array.
*/
public function error (array|string $data, int $status = StatusCode::INTERNAL_SERVER_ERROR): string|array;
public function error (string|array $data, int $status = StatusCode::INTERNAL_SERVER_ERROR): string|array;

/**
* This PHP function returns a success response in various formats based on the specified response
* type.
*
* @param array data The `data` parameter in the `success` function can be either an array or a
* @param string|array data The `data` parameter in the `success` function can be either an array or a
* string. It is wrapped in an array with the key 'success' before being returned based on the
* response type specified.
* @param int status The `status` parameter in the `success` function represents the HTTP status code
Expand All @@ -140,5 +140,5 @@ public function error (array|string $data, int $status = StatusCode::INTERNAL_SE
* type. The specific response format returned depends on the value of `->response` which can be
* JSON, HTML, XML,
*/
public function success (array|string $data, int $status = StatusCode::OK): string|array;
public function success (string|array $data, int $status = StatusCode::OK): string|array;
}

0 comments on commit d9342fa

Please sign in to comment.