@@ -182,14 +182,15 @@ discard block |
||
182 | 182 | try |
183 | 183 | { |
184 | 184 | $token = JWT::encode($payload, $privateKey, 'RS512'); |
185 | - } |
|
186 | - catch (\Exception $e) |
|
185 | + } catch (\Exception $e) |
|
187 | 186 | { |
188 | 187 | Log::instance()->error($e->getMessage().PHP_EOL.$e->getTraceAsString()); |
189 | 188 | throw new Exception\JSON('unable to create JWT token', $e); |
190 | 189 | } |
191 | 190 | |
192 | - if (isset($ar['data'])) unset($ar['data']); |
|
191 | + if (isset($ar['data'])) { |
|
192 | + unset($ar['data']); |
|
193 | + } |
|
193 | 194 | |
194 | 195 | $ar['token'] = $token; |
195 | 196 | } |
@@ -216,8 +217,7 @@ discard block |
||
216 | 217 | $body = $httpresponse->getBody()->getContents(); |
217 | 218 | Log::instance()->debug('got response:'.PHP_EOL.$body); |
218 | 219 | $response = new $this->response_class($body); |
219 | - } |
|
220 | - catch (\GuzzleHttp\Exception\TransferException $e) |
|
220 | + } catch (\GuzzleHttp\Exception\TransferException $e) |
|
221 | 221 | { |
222 | 222 | Log::instance()->debug('request:'.PHP_EOL.\GuzzleHttp\Psr7\str($e->getRequest())); |
223 | 223 | if ($e->hasResponse()) { |