Completed
Push — master ( 361e7c...d7e260 )
by Artem
03:39
created
src/AuthService.php 2 patches
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
      */
82 82
     public function login(string $email, string $password, bool $remember = false)
83 83
     {
84
-        if($this->disabled()) {
84
+        if ($this->disabled()) {
85 85
             return $this->handleFallback('login', compact('email', 'password', 'remember'));
86 86
         }
87 87
 
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
      */
104 104
     public function unsafeLogin(string $email, bool $remember = false)
105 105
     {
106
-        if($this->disabled()) {
106
+        if ($this->disabled()) {
107 107
             return $this->handleFallback('unsafeLogin', compact('email', 'remember'));
108 108
         }
109 109
 
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
      */
120 120
     public function logout()
121 121
     {
122
-        if($this->disabled()) {
122
+        if ($this->disabled()) {
123 123
             return $this->handleFallback('logout');
124 124
         }
125 125
 
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
      */
142 142
     public function register(int $userId, string $name, string $email, string $password, string $country)
143 143
     {
144
-        if($this->disabled()) {
144
+        if ($this->disabled()) {
145 145
             return [];
146 146
         }
147 147
 
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
      */
160 160
     public function forgot(string $email)
161 161
     {
162
-        if($this->disabled()) {
162
+        if ($this->disabled()) {
163 163
             return $this->handleFallback('forgot', compact('email'));
164 164
         }
165 165
 
@@ -180,13 +180,13 @@  discard block
 block discarded – undo
180 180
      */
181 181
     public function validatePasswordResetToken(string $token, string $email)
182 182
     {
183
-        if($this->disabled()) {
183
+        if ($this->disabled()) {
184 184
             return $this->handleFallback('validateReset', compact('token', 'email'));
185 185
         }
186 186
 
187 187
         $response = $this->client->request('validateReset', compact('token', 'email'));
188 188
 
189
-        if(!$this->client->success(true)) {
189
+        if (!$this->client->success(true)) {
190 190
             return false;
191 191
         }
192 192
 
@@ -209,13 +209,13 @@  discard block
 block discarded – undo
209 209
     {
210 210
         $parameters = compact('token', 'email', 'password', 'confirmation');
211 211
 
212
-        if($this->disabled()) {
212
+        if ($this->disabled()) {
213 213
             return $this->handleFallback('resetPassword', $parameters);
214 214
         }
215 215
 
216 216
         $response = $this->client->request('reset', $parameters);
217 217
 
218
-        if(!$this->client->success(true)) {
218
+        if (!$this->client->success(true)) {
219 219
             return false;
220 220
         }
221 221
 
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
      */
235 235
     public function update(int $id, ?string $name, ?string $email, ?string $password)
236 236
     {
237
-        if($this->disabled()) {
237
+        if ($this->disabled()) {
238 238
             return false;
239 239
         }
240 240
 
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
 
243 243
         $response = $this->client->request('update', compact('id', 'attributes'));
244 244
 
245
-        if(!$this->client->success(true)) {
245
+        if (!$this->client->success(true)) {
246 246
             return false;
247 247
         }
248 248
 
@@ -256,18 +256,18 @@  discard block
 block discarded – undo
256 256
      */
257 257
     public function retrieveByToken()
258 258
     {
259
-        if($this->disabled()) {
259
+        if ($this->disabled()) {
260 260
             return null;
261 261
         }
262 262
 
263 263
         try {
264 264
             $response = $this->client->request('me');
265 265
         }
266
-        catch(\Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException $e) {
266
+        catch (\Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException $e) {
267 267
             return null;
268 268
         }
269 269
 
270
-        if(!$this->client->success(true)) {
270
+        if (!$this->client->success(true)) {
271 271
             return null;
272 272
         }
273 273
 
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
     {
302 302
         $handler = camel_case(str_replace('.', ' ', $key));
303 303
 
304
-        if(!method_exists($this->handlersContainer, $handler)) {
304
+        if (!method_exists($this->handlersContainer, $handler)) {
305 305
             throw new \InvalidArgumentException("Handler `{$handler}` cannot be found");
306 306
         }
307 307
 
@@ -346,10 +346,10 @@  discard block
 block discarded – undo
346 346
         try {
347 347
             $output = $callback();
348 348
         }
349
-        catch(\Exception $e) {
349
+        catch (\Exception $e) {
350 350
             DB::rollBack();
351 351
 
352
-            if(is_null($fallback)) {
352
+            if (is_null($fallback)) {
353 353
                 throw $e;
354 354
             }
355 355
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -262,8 +262,7 @@  discard block
 block discarded – undo
262 262
 
263 263
         try {
264 264
             $response = $this->client->request('me');
265
-        }
266
-        catch(\Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException $e) {
265
+        } catch(\Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException $e) {
267 266
             return null;
268 267
         }
269 268
 
@@ -345,8 +344,7 @@  discard block
 block discarded – undo
345 344
 
346 345
         try {
347 346
             $output = $callback();
348
-        }
349
-        catch(\Exception $e) {
347
+        } catch(\Exception $e) {
350 348
             DB::rollBack();
351 349
 
352 350
             if(is_null($fallback)) {
Please login to merge, or discard this patch.