@@ -139,8 +139,7 @@ |
||
| 139 | 139 | try |
| 140 | 140 | { |
| 141 | 141 | $decoded = (array) JWT::decode($token, $this->uapay_public_key(), array('RS512')); |
| 142 | - } |
|
| 143 | - catch (\Exception $e) |
|
| 142 | + } catch (\Exception $e) |
|
| 144 | 143 | { |
| 145 | 144 | Log::instance()->error($e->getMessage().PHP_EOL.$e->getTraceAsString()); |
| 146 | 145 | throw new Exception\JSON('unable to decode JWT token', $e); |
@@ -22,8 +22,7 @@ |
||
| 22 | 22 | $this->check_exists($fname); |
| 23 | 23 | |
| 24 | 24 | $key = $this->load($fname); |
| 25 | - } |
|
| 26 | - catch (\Exception $e) |
|
| 25 | + } catch (\Exception $e) |
|
| 27 | 26 | { |
| 28 | 27 | throw new Exception\Runtime('The file with the '.$type.' key was '.$e->getMessage().'!'); |
| 29 | 28 | } |
@@ -140,7 +140,9 @@ discard block |
||
| 140 | 140 | $payload['iat'] = $this->get_param_iat(); |
| 141 | 141 | $ar['token'] = $this->token_encode($payload); |
| 142 | 142 | |
| 143 | - if (isset($ar['data'])) unset($ar['data']); |
|
| 143 | + if (isset($ar['data'])) { |
|
| 144 | + unset($ar['data']); |
|
| 145 | + } |
|
| 144 | 146 | } |
| 145 | 147 | $json = json_encode($ar, JSON_UNESCAPED_SLASHES); |
| 146 | 148 | |
@@ -174,8 +176,7 @@ discard block |
||
| 174 | 176 | try |
| 175 | 177 | { |
| 176 | 178 | $token = JWT::encode($payload, $this->own_private_key(), 'RS512'); |
| 177 | - } |
|
| 178 | - catch (\Exception $e) |
|
| 179 | + } catch (\Exception $e) |
|
| 179 | 180 | { |
| 180 | 181 | Log::instance()->error($e->getMessage().PHP_EOL.$e->getTraceAsString()); |
| 181 | 182 | throw new Exception\JSON('unable to create JWT token', $e); |
@@ -205,8 +206,7 @@ discard block |
||
| 205 | 206 | $body = $httpresponse->getBody()->getContents(); |
| 206 | 207 | Log::instance()->debug('got response:'.PHP_EOL.$body); |
| 207 | 208 | $response = new $this->response_class($body, $this->jwt); |
| 208 | - } |
|
| 209 | - catch (\GuzzleHttp\Exception\RequestException $e) |
|
| 209 | + } catch (\GuzzleHttp\Exception\RequestException $e) |
|
| 210 | 210 | { |
| 211 | 211 | Log::instance()->debug('request:'.PHP_EOL.\GuzzleHttp\Psr7\str($e->getRequest())); |
| 212 | 212 | if ($e->hasResponse()) { |