Completed
Push — master ( 3bc4a5...384a55 )
by
unknown
11:49 queued 10s
created
src/AuthService.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
      */
85 85
     public function login(string $email, string $password, bool $remember = false)
86 86
     {
87
-        if($this->disabled()) {
87
+        if ($this->disabled()) {
88 88
             return $this->handleFallback('login', compact('email', 'password', 'remember'));
89 89
         }
90 90
 
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
      */
107 107
     public function unsafeLogin(string $email, bool $remember = false)
108 108
     {
109
-        if($this->disabled()) {
109
+        if ($this->disabled()) {
110 110
             return $this->handleFallback('unsafeLogin', compact('email', 'remember'));
111 111
         }
112 112
 
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
      */
123 123
     public function logout()
124 124
     {
125
-        if($this->disabled()) {
125
+        if ($this->disabled()) {
126 126
             return $this->handleFallback('logout');
127 127
         }
128 128
 
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
      */
145 145
     public function register(int $userId, string $name, string $email, string $password, string $country)
146 146
     {
147
-        if($this->disabled()) {
147
+        if ($this->disabled()) {
148 148
             return [];
149 149
         }
150 150
 
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
      */
163 163
     public function forgot(string $email)
164 164
     {
165
-        if($this->disabled()) {
165
+        if ($this->disabled()) {
166 166
             return $this->handleFallback('forgot', compact('email'));
167 167
         }
168 168
 
@@ -183,13 +183,13 @@  discard block
 block discarded – undo
183 183
      */
184 184
     public function validatePasswordResetToken(string $token, string $email)
185 185
     {
186
-        if($this->disabled()) {
186
+        if ($this->disabled()) {
187 187
             return $this->handleFallback('validateReset', compact('token', 'email'));
188 188
         }
189 189
 
190 190
         $response = $this->client->request('validateReset', compact('token', 'email'));
191 191
 
192
-        if(!$this->client->success(true)) {
192
+        if (!$this->client->success(true)) {
193 193
             return false;
194 194
         }
195 195
 
@@ -212,13 +212,13 @@  discard block
 block discarded – undo
212 212
     {
213 213
         $parameters = compact('token', 'email', 'password', 'confirmation');
214 214
 
215
-        if($this->disabled()) {
215
+        if ($this->disabled()) {
216 216
             return $this->handleFallback('resetPassword', $parameters);
217 217
         }
218 218
 
219 219
         $response = $this->client->request('reset', $parameters);
220 220
 
221
-        if(!$this->client->success(true)) {
221
+        if (!$this->client->success(true)) {
222 222
             return false;
223 223
         }
224 224
 
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
      */
239 239
     public function update(int $id, ?string $name, ?string $email, ?string $password, ?string $country)
240 240
     {
241
-        if($this->disabled()) {
241
+        if ($this->disabled()) {
242 242
             return false;
243 243
         }
244 244
 
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 
247 247
         $response = $this->client->request('update', compact('id', 'attributes'));
248 248
 
249
-        if(!$this->client->success(true)) {
249
+        if (!$this->client->success(true)) {
250 250
             return false;
251 251
         }
252 252
 
@@ -262,13 +262,13 @@  discard block
 block discarded – undo
262 262
      */
263 263
     public function delete(int $id)
264 264
     {
265
-        if($this->disabled()) {
265
+        if ($this->disabled()) {
266 266
             return false;
267 267
         }
268 268
 
269 269
         $response = $this->client->request('delete', compact('id'));
270 270
 
271
-        if(!$this->client->success(true)) {
271
+        if (!$this->client->success(true)) {
272 272
             return false;
273 273
         }
274 274
 
@@ -284,13 +284,13 @@  discard block
 block discarded – undo
284 284
      */
285 285
     public function restore(int $id)
286 286
     {
287
-        if($this->disabled()) {
287
+        if ($this->disabled()) {
288 288
             return false;
289 289
         }
290 290
 
291 291
         $response = $this->client->request('restore', compact('id'));
292 292
 
293
-        if(!$this->client->success(true)) {
293
+        if (!$this->client->success(true)) {
294 294
             return false;
295 295
         }
296 296
 
@@ -304,18 +304,18 @@  discard block
 block discarded – undo
304 304
      */
305 305
     public function retrieveByToken()
306 306
     {
307
-        if($this->disabled()) {
307
+        if ($this->disabled()) {
308 308
             return null;
309 309
         }
310 310
 
311 311
         try {
312 312
             $response = $this->client->request('me');
313 313
         }
314
-        catch(\Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException $e) {
314
+        catch (\Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException $e) {
315 315
             return null;
316 316
         }
317 317
 
318
-        if(!$this->client->success(true)) {
318
+        if (!$this->client->success(true)) {
319 319
             return null;
320 320
         }
321 321
 
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
     {
350 350
         $handler = Str::camel(str_replace('.', ' ', $key));
351 351
 
352
-        if(!method_exists($this->handlersContainer, $handler)) {
352
+        if (!method_exists($this->handlersContainer, $handler)) {
353 353
             throw new \InvalidArgumentException("Handler `{$handler}` cannot be found");
354 354
         }
355 355
 
@@ -389,11 +389,11 @@  discard block
 block discarded – undo
389 389
     {
390 390
         $cache = new Cache();
391 391
 
392
-        if(!func_num_args()) {
392
+        if (!func_num_args()) {
393 393
             return $cache;
394 394
         }
395 395
 
396
-        if(func_num_args() === 1) {
396
+        if (func_num_args() === 1) {
397 397
             return $cache->get($key);
398 398
         }
399 399
 
@@ -413,11 +413,11 @@  discard block
 block discarded – undo
413 413
     {
414 414
         $cache = new Cache();
415 415
 
416
-        if(func_num_args() === 1) {
416
+        if (func_num_args() === 1) {
417 417
             return $cache->getUserParams($remoteId);
418 418
         }
419 419
 
420
-        if(func_num_args() === 2) {
420
+        if (func_num_args() === 2) {
421 421
             return $cache->getUserParam($remoteId, $key);
422 422
         }
423 423
 
@@ -441,10 +441,10 @@  discard block
 block discarded – undo
441 441
         try {
442 442
             $output = $callback();
443 443
         }
444
-        catch(\Exception $e) {
444
+        catch (\Exception $e) {
445 445
             DB::rollBack();
446 446
 
447
-            if(is_null($fallback)) {
447
+            if (is_null($fallback)) {
448 448
                 throw $e;
449 449
             }
450 450
 
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
      */
528 528
     protected function encrypter(): Encrypter
529 529
     {
530
-        if ($key = config('connector.auth.cryptKey')){
530
+        if ($key = config('connector.auth.cryptKey')) {
531 531
             throw new \RuntimeException('The crypt key should be provided.');
532 532
         }
533 533
 
Please login to merge, or discard this patch.