@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | throw new ApiException('No hay una respuesta HTTP previa para obtener el cuerpo.'); |
148 | 148 | } |
149 | 149 | |
150 | - return (string)$this->last_response->getBody(); |
|
150 | + return (string) $this->last_response->getBody(); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | /** |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | $decodedBody = json_decode($body, true); |
168 | 168 | |
169 | 169 | if (json_last_error() !== JSON_ERROR_NONE) { |
170 | - throw new ApiException('Error al decodificar JSON: ' . json_last_error_msg()); |
|
170 | + throw new ApiException('Error al decodificar JSON: '.json_last_error_msg()); |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | return $decodedBody; |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | } elseif (!empty($body['exception'])) { |
217 | 217 | $body = $this->getError()->message; |
218 | 218 | } else { |
219 | - $body = 'Error no determinado: ' . json_encode($body); |
|
219 | + $body = 'Error no determinado: '.json_encode($body); |
|
220 | 220 | } |
221 | 221 | } |
222 | 222 | |
@@ -307,11 +307,11 @@ discard block |
||
307 | 307 | } |
308 | 308 | $method = $method ?: ($data ? 'POST' : 'GET'); |
309 | 309 | $client = new \GuzzleHttp\Client(); |
310 | - $this->last_url = $this->api_url . $this->api_prefix . '/'. $this->api_version . $resource; |
|
310 | + $this->last_url = $this->api_url.$this->api_prefix.'/'.$this->api_version.$resource; |
|
311 | 311 | |
312 | 312 | // preparar cabeceras que se usarán |
313 | 313 | $options[\GuzzleHttp\RequestOptions::HEADERS] = array_merge([ |
314 | - 'Authorization' => 'Bearer ' . $this->api_token, |
|
314 | + 'Authorization' => 'Bearer '.$this->api_token, |
|
315 | 315 | 'Content-Type' => 'application/json', |
316 | 316 | 'Accept' => 'application/json', |
317 | 317 | ], $headers); |
@@ -361,10 +361,10 @@ discard block |
||
361 | 361 | |
362 | 362 | // Se maneja el caso donde no se encuentra un mensaje de error específico |
363 | 363 | if (!$message || $message === '') { |
364 | - $message = '[API Gateway] Código HTTP ' . $code . ': ' . $reasonPhrase; |
|
364 | + $message = '[API Gateway] Código HTTP '.$code.': '.$reasonPhrase; |
|
365 | 365 | } |
366 | 366 | |
367 | - return (object)[ |
|
367 | + return (object) [ |
|
368 | 368 | 'code' => $code, |
369 | 369 | 'message' => $message, |
370 | 370 | ]; |