@@ -120,7 +120,7 @@ |
||
| 120 | 120 | ]) |
| 121 | 121 | ], |
| 122 | 122 | [ |
| 123 | - $method => function () use ($response) { |
|
| 123 | + $method => function() use ($response) { |
|
| 124 | 124 | return $response; |
| 125 | 125 | } |
| 126 | 126 | ] |
@@ -52,12 +52,12 @@ |
||
| 52 | 52 | ApiResponse $api_response, |
| 53 | 53 | ?Throwable $previous = null |
| 54 | 54 | ): AbstractApiException | Error { |
| 55 | - return match ($api_response->getStatus()) { |
|
| 56 | - 401 => new UnauthorizedApiException(previous: $previous), |
|
| 57 | - 403 => new InaccessibleResourceException(previous: $previous), |
|
| 58 | - 404 => new EntityNotFoundException(previous: $previous), |
|
| 59 | - 422 => new MalformedPayloadException(previous: $previous, errors: $api_response->getData()), |
|
| 60 | - default => new Error(message: "Undefined error", code: 1000, previous: $previous), |
|
| 55 | + return match($api_response->getStatus()) { |
|
| 56 | + 401 => new UnauthorizedApiException(previous : $previous), |
|
| 57 | + 403 => new InaccessibleResourceException(previous : $previous), |
|
| 58 | + 404 => new EntityNotFoundException(previous : $previous), |
|
| 59 | + 422 => new MalformedPayloadException(previous : $previous, errors : $api_response->getData()), |
|
| 60 | + default => new Error(message : "Undefined error", code : 1000, previous : $previous), |
|
| 61 | 61 | }; |
| 62 | 62 | } |
| 63 | 63 | } |