@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | * @return HttpResponse |
| 185 | 185 | */ |
| 186 | 186 | public static function success($data = null, $api_code = null, array $lang_args = null, |
| 187 | - int $http_code = null, int $encoding_options = null): HttpResponse |
|
| 187 | + int $http_code = null, int $encoding_options = null): HttpResponse |
|
| 188 | 188 | { |
| 189 | 189 | return static::buildSuccessResponse($data, $api_code, $lang_args, $http_code, $encoding_options); |
| 190 | 190 | } |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | * @throws \InvalidArgumentException Thrown when provided arguments are invalid. |
| 230 | 230 | */ |
| 231 | 231 | protected static function buildSuccessResponse($data = null, int $api_code = null, array $lang_args = null, |
| 232 | - int $http_code = null, int $encoding_options = null): HttpResponse |
|
| 232 | + int $http_code = null, int $encoding_options = null): HttpResponse |
|
| 233 | 233 | { |
| 234 | 234 | $http_code = $http_code ?? static::DEFAULT_HTTP_CODE_OK; |
| 235 | 235 | $api_code = $api_code ?? BaseApiCodes::OK(); |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | * @return HttpResponse |
| 256 | 256 | */ |
| 257 | 257 | public static function error(int $api_code, array $lang_args = null, $data = null, int $http_code = null, |
| 258 | - int $encoding_options = null): HttpResponse |
|
| 258 | + int $encoding_options = null): HttpResponse |
|
| 259 | 259 | { |
| 260 | 260 | return static::buildErrorResponse($data, $api_code, $http_code, $lang_args, $encoding_options); |
| 261 | 261 | } |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | * @return HttpResponse |
| 271 | 271 | */ |
| 272 | 272 | public static function errorWithData(int $api_code, $data, array $lang_args = null, |
| 273 | - int $encoding_options = null): HttpResponse |
|
| 273 | + int $encoding_options = null): HttpResponse |
|
| 274 | 274 | { |
| 275 | 275 | return static::buildErrorResponse($data, $api_code, null, $lang_args, $encoding_options); |
| 276 | 276 | } |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | * @throws \InvalidArgumentException if http_code is @null |
| 289 | 289 | */ |
| 290 | 290 | public static function errorWithDataAndHttpCode(int $api_code, $data, int $http_code, array $lang_args = null, |
| 291 | - int $encoding_options = null): HttpResponse |
|
| 291 | + int $encoding_options = null): HttpResponse |
|
| 292 | 292 | { |
| 293 | 293 | return static::buildErrorResponse($data, $api_code, $http_code, $lang_args, $encoding_options); |
| 294 | 294 | } |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | * @return HttpResponse |
| 319 | 319 | */ |
| 320 | 320 | public static function errorWithMessageAndData(int $api_code, string $error_message, $data, |
| 321 | - int $http_code = null, int $encoding_options = null): HttpResponse |
|
| 321 | + int $http_code = null, int $encoding_options = null): HttpResponse |
|
| 322 | 322 | { |
| 323 | 323 | return static::buildErrorResponse($data, $api_code, $http_code, null, |
| 324 | 324 | $error_message, null, $encoding_options); |
@@ -336,8 +336,8 @@ discard block |
||
| 336 | 336 | * @return HttpResponse |
| 337 | 337 | */ |
| 338 | 338 | public static function errorWithMessageAndDataAndDebug(int $api_code, string $error_message, $data, |
| 339 | - int $http_code = null, int $encoding_options = null, |
|
| 340 | - array $debug_data = null): HttpResponse |
|
| 339 | + int $http_code = null, int $encoding_options = null, |
|
| 340 | + array $debug_data = null): HttpResponse |
|
| 341 | 341 | { |
| 342 | 342 | return static::buildErrorResponse($data, $api_code, $http_code, null, |
| 343 | 343 | $error_message, null, $encoding_options, $debug_data); |
@@ -376,8 +376,8 @@ discard block |
||
| 376 | 376 | * @noinspection MoreThanThreeArgumentsInspection |
| 377 | 377 | */ |
| 378 | 378 | protected static function buildErrorResponse($data, int $api_code, int $http_code = null, array $lang_args = null, |
| 379 | - string $message = null, array $headers = null, int $encoding_options = null, |
|
| 380 | - array $debug_data = null): HttpResponse |
|
| 379 | + string $message = null, array $headers = null, int $encoding_options = null, |
|
| 380 | + array $debug_data = null): HttpResponse |
|
| 381 | 381 | { |
| 382 | 382 | $http_code = $http_code ?? static::DEFAULT_HTTP_CODE_ERROR; |
| 383 | 383 | $headers = $headers ?? []; |
@@ -420,8 +420,8 @@ discard block |
||
| 420 | 420 | * @noinspection MoreThanThreeArgumentsInspection |
| 421 | 421 | */ |
| 422 | 422 | protected static function make(bool $success, int $api_code, $message_or_api_code, $data = null, |
| 423 | - int $http_code = null, array $lang_args = null, array $headers = null, |
|
| 424 | - int $encoding_options = null, array $debug_data = null): HttpResponse |
|
| 423 | + int $http_code = null, array $lang_args = null, array $headers = null, |
|
| 424 | + int $encoding_options = null, array $debug_data = null): HttpResponse |
|
| 425 | 425 | { |
| 426 | 426 | $headers = $headers ?? []; |
| 427 | 427 | $http_code = $http_code ?? ($success ? static::DEFAULT_HTTP_CODE_OK : static::DEFAULT_HTTP_CODE_ERROR); |
@@ -477,7 +477,7 @@ discard block |
||
| 477 | 477 | * @throws \RuntimeException in case of missing or invalid "classes" mapping configuration |
| 478 | 478 | */ |
| 479 | 479 | protected static function buildResponse(bool $success, int $api_code, string $message, $data = null, |
| 480 | - array $debug_data = null): array |
|
| 480 | + array $debug_data = null): array |
|
| 481 | 481 | { |
| 482 | 482 | // ensure $data is either @null, array or object of class with configured mapping. |
| 483 | 483 | if ($data !== null) { |