Passed
Push — master ( e3b573...48db62 )
by Dmitry
01:54
created
src/Request.php 1 patch
Braces   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -162,7 +162,9 @@  discard block
 block discarded – undo
162 162
             $payload['iat'] = $this->get_param_iat();
163 163
             $ar['token'] = $this->token_encode($payload);
164 164
 
165
-            if (isset($ar['data'])) unset($ar['data']);
165
+            if (isset($ar['data'])) {
166
+                unset($ar['data']);
167
+            }
166 168
         }
167 169
         $json = json_encode($ar, JSON_UNESCAPED_SLASHES);
168 170
 
@@ -216,8 +218,7 @@  discard block
 block discarded – undo
216 218
         try
217 219
         {
218 220
             $token = JWT::encode($payload, $this->own_private_key(), 'RS512');
219
-        }
220
-        catch (\Exception $e)
221
+        } catch (\Exception $e)
221 222
         {
222 223
             Log::instance()->error($e->getMessage().PHP_EOL.$e->getTraceAsString());
223 224
             throw new Exception\JSON('unable to create JWT token', $e);
@@ -247,8 +248,7 @@  discard block
 block discarded – undo
247 248
             $body = $httpresponse->getBody()->getContents();
248 249
             Log::instance()->debug('got response:'.PHP_EOL.$body);
249 250
             $response = new $this->response_class($body, $this->jwt);
250
-        }
251
-        catch (\GuzzleHttp\Exception\TransferException $e)
251
+        } catch (\GuzzleHttp\Exception\TransferException $e)
252 252
         {
253 253
             Log::instance()->debug('request:'.PHP_EOL.\GuzzleHttp\Psr7\str($e->getRequest()));
254 254
             if ($e->hasResponse()) {
Please login to merge, or discard this patch.
src/Response.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -139,8 +139,7 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.