Completed
Push — master ( 0f8f78...0a69d4 )
by Camilo
13s
created
src/TgLog.php 1 patch
Braces   +10 added lines, -8 removed lines patch added patch discarded remove patch
@@ -157,10 +157,11 @@  discard block
 block discarded – undo
157 157
         },
158 158
             function (RequestException $exception) use ($deferred)
159 159
             {
160
-                if (!empty($exception->getResponse()->getBody()))
161
-                    $deferred->resolve(new TelegramDocument($exception->getResponse()));
162
-                else
163
-                    $deferred->reject($exception);
160
+                if (!empty($exception->getResponse()->getBody())) {
161
+                                    $deferred->resolve(new TelegramDocument($exception->getResponse()));
162
+                } else {
163
+                                    $deferred->reject($exception);
164
+                }
164 165
             });
165 166
     }
166 167
 
@@ -219,10 +220,11 @@  discard block
 block discarded – undo
219 220
         },
220 221
             function (RequestException $exception) use ($deferred)
221 222
             {
222
-                if (!empty($exception->getResponse()->getBody()))
223
-                    $deferred->resolve(new TelegramRawData((string) $exception->getResponse()->getBody(), $exception));
224
-                else
225
-                    $deferred->reject($exception);
223
+                if (!empty($exception->getResponse()->getBody())) {
224
+                                    $deferred->resolve(new TelegramRawData((string) $exception->getResponse()->getBody(), $exception));
225
+                } else {
226
+                                    $deferred->reject($exception);
227
+                }
226 228
             });
227 229
 
228 230
         return $deferred;
Please login to merge, or discard this patch.
src/GuzzleRequestHandler.php 1 patch
Braces   +7 added lines, -8 removed lines patch added patch discarded remove patch
@@ -69,15 +69,13 @@  discard block
 block discarded – undo
69 69
         try {
70 70
             $response = $this->httpClient->post($uri, $formData);
71 71
             $this->logger->debug('Got response back from Telegram, applying json_decode');
72
-        }
73
-        catch (ClientException $e) {
72
+        } catch (ClientException $e) {
74 73
             $response = $e->getResponse();
75 74
             // It can happen that we have a network problem, in such case, we can't do nothing about it, so rethrow
76 75
             if (empty($response)) {
77 76
                 throw $e;
78 77
             }
79
-        }
80
-        finally {
78
+        } finally {
81 79
             return new TelegramRawData((string) $response->getBody(), $e);
82 80
         }
83 81
     }
@@ -98,10 +96,11 @@  discard block
 block discarded – undo
98 96
             $deferred->resolve(new TelegramRawData((string) $response->getBody()));
99 97
         },
100 98
             function (RequestException $exception) use ($deferred) {
101
-                if (!empty($exception->getResponse()->getBody()))
102
-                    $deferred->resolve(new TelegramRawData((string) $exception->getResponse()->getBody(), $exception));
103
-                else
104
-                    $deferred->reject($exception);
99
+                if (!empty($exception->getResponse()->getBody())) {
100
+                                    $deferred->resolve(new TelegramRawData((string) $exception->getResponse()->getBody(), $exception));
101
+                } else {
102
+                                    $deferred->reject($exception);
103
+                }
105 104
             });
106 105
 
107 106
         return $deferred;
Please login to merge, or discard this patch.