Passed
Push — master ( c34bce...f6db7f )
by Artem
01:28
created
src/ServiceProvider.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
      */
65 65
     protected function loadConsoleCommands()
66 66
     {
67
-        if(!$this->app->runningInConsole()) {
67
+        if (!$this->app->runningInConsole()) {
68 68
             return;
69 69
         }
70 70
 
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
     protected function loadGuards()
85 85
     {
86 86
         // Skip loading guards if an application running in the console
87
-        if($this->app->runningInConsole()) {
87
+        if ($this->app->runningInConsole()) {
88 88
             return;
89 89
         }
90 90
 
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
             $this->app['auth']->guard('authService')
93 93
         );
94 94
 
95
-        if(!$this->enabled()) {
95
+        if (!$this->enabled()) {
96 96
             $this->app['authService']->setFallbackGuard(
97 97
                 $this->app['auth']->guard('fallback')
98 98
             );
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
         });
147 147
 
148 148
         // Register the fallback driver if service is disabled
149
-        if(!$this->app->runningInConsole() && !$this->enabled()) {
149
+        if (!$this->app->runningInConsole() && !$this->enabled()) {
150 150
             $this->app['auth']->shouldUse('fallback');
151 151
         }
152 152
     }
Please login to merge, or discard this patch.
src/Commands/SyncExport.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -43,11 +43,11 @@  discard block
 block discarded – undo
43 43
 
44 44
         $syncer = new Syncer($locals = $this->syncingUsers(), $this->modes());
45 45
 
46
-        if($locals->isEmpty()) {
46
+        if ($locals->isEmpty()) {
47 47
             $this->info('No local users found.');
48 48
         }
49 49
 
50
-        if(!$this->confirm('There are ' . $locals->count() . ' local user(s) to export. Continue?', $this->option('no-interaction'))) {
50
+        if (!$this->confirm('There are ' . $locals->count() . ' local user(s) to export. Continue?', $this->option('no-interaction'))) {
51 51
             return;
52 52
         }
53 53
 
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
      */
103 103
     private function syncingUsers()
104 104
     {
105
-        if(!count($ids = ConsoleHelper::stringToArray($this->option('users')))) {
105
+        if (!count($ids = ConsoleHelper::stringToArray($this->option('users')))) {
106 106
             return Syncer::retrieveLocals();
107 107
         }
108 108
 
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
      */
120 120
     private function filePath()
121 121
     {
122
-        if(!$path = $this->option('path')) {
122
+        if (!$path = $this->option('path')) {
123 123
             $path = storage_path('app');
124 124
         }
125 125
 
Please login to merge, or discard this patch.
src/Commands/SyncImport.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
      */
40 40
     public function handle()
41 41
     {
42
-        if(!$key = $this->option('key')) {
42
+        if (!$key = $this->option('key')) {
43 43
             throw new \InvalidArgumentException('Encryption key must be passed.');
44 44
         }
45 45
 
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
         $changes = $syncer->getForeignersCount();
63 63
 
64
-        if(!$this->confirm('Apply ' . $changes . ' changes?', true)) {
64
+        if (!$this->confirm('Apply ' . $changes . ' changes?', true)) {
65 65
             return;
66 66
         }
67 67
 
@@ -99,15 +99,15 @@  discard block
 block discarded – undo
99 99
      */
100 100
     protected function flushListeners()
101 101
     {
102
-        if(class_exists('\App\Http\Models\User')) {
102
+        if (class_exists('\App\Http\Models\User')) {
103 103
             \App\Http\Models\User::flushEventListeners();
104 104
         }
105 105
 
106
-        if(class_exists('App\Http\Models\CustomerProfile')) {
106
+        if (class_exists('App\Http\Models\CustomerProfile')) {
107 107
             \App\Http\Models\CustomerProfile::flushEventListeners();
108 108
         }
109 109
 
110
-        if(class_exists('App\Modules\Billing\Models\Account::class')) {
110
+        if (class_exists('App\Modules\Billing\Models\Account::class')) {
111 111
             \App\Modules\Billing\Models\Account::flushEventListeners();
112 112
         }
113 113
     }
Please login to merge, or discard this patch.
src/Helpers/ConsoleHelper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
      */
23 23
     public static function stringToArray(string $string = null, string $valueDelimiter = ':', string $itemDelimiter = ',')
24 24
     {
25
-        if(is_null($string)) {
25
+        if (is_null($string)) {
26 26
             return [];
27 27
         }
28 28
 
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
             $key = array_get($item, 0);
36 36
             $value = array_get($item, 1);
37 37
 
38
-            if(is_null($value)) {
38
+            if (is_null($value)) {
39 39
                 $value = $key;
40 40
                 $key = $index;
41 41
             }
Please login to merge, or discard this patch.
src/Commands/SyncUsers.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -66,11 +66,11 @@
 block discarded – undo
66 66
 
67 67
         $syncer = new Syncer($locals = $this->syncingUsers(), $this->modes());
68 68
 
69
-        if($locals->isEmpty()) {
69
+        if ($locals->isEmpty()) {
70 70
             $this->info('No local users found.');
71 71
         }
72 72
 
73
-        if(!$this->confirm('There are ' . $locals->count() . ' local user(s) to sync. Continue?', $this->option('no-interaction'))) {
73
+        if (!$this->confirm('There are ' . $locals->count() . ' local user(s) to sync. Continue?', $this->option('no-interaction'))) {
74 74
             return;
75 75
         }
76 76
 
Please login to merge, or discard this patch.
src/Concerns/UserHelpers.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@
 block discarded – undo
100 100
      */
101 101
     public static function deleteEmail(string $email, int $index): string
102 102
     {
103
-        if(strpos($email, ".{$index}.deleted" !== false)) {
103
+        if (strpos($email, ".{$index}.deleted" !== false)) {
104 104
             return $email;
105 105
         }
106 106
 
Please login to merge, or discard this patch.
src/Commands/ManageUsers.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -84,13 +84,13 @@  discard block
 block discarded – undo
84 84
      */
85 85
     protected function runActionHandler(string $action)
86 86
     {
87
-        if(!in_array($action, $this->actions)) {
87
+        if (!in_array($action, $this->actions)) {
88 88
             throw new \InvalidArgumentException("Unknown action `{$action}` passed");
89 89
         }
90 90
 
91 91
         $actionHandler = 'handle' . studly_case($action);
92 92
 
93
-        if(!method_exists($this, $actionHandler)) {
93
+        if (!method_exists($this, $actionHandler)) {
94 94
             throw new \InvalidArgumentException("Cannot find action handler `{$actionHandler}`");
95 95
         }
96 96
 
@@ -137,12 +137,12 @@  discard block
 block discarded – undo
137 137
     {
138 138
         $users = $this->retrieveUsers(['id' => $this->ids], true);
139 139
 
140
-        if($users->isEmpty()) {
140
+        if ($users->isEmpty()) {
141 141
             $this->info('No users found.');
142 142
             return;
143 143
         }
144 144
         else {
145
-            if(!$this->confirm('Do you want to restore ' . $users->count() . ' user(s)?')) {
145
+            if (!$this->confirm('Do you want to restore ' . $users->count() . ' user(s)?')) {
146 146
                 return;
147 147
             }
148 148
         }
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 
154 154
                 $this->info('User #' . $user->id . ' (' . $user->email . ') successfully restored.');
155 155
             }
156
-            catch(\Exception $e) {
156
+            catch (\Exception $e) {
157 157
                 $this->error('User #' . $user->id . ' (' . $user->email . ') cannot be restored. ' . $e->getMessage());
158 158
             }
159 159
         }
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
             $query->where($column, $value);
177 177
         }
178 178
 
179
-        if($onlyTrashed) {
179
+        if ($onlyTrashed) {
180 180
             $query->whereNotNull('deleted_at');
181 181
         }
182 182
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -140,8 +140,7 @@  discard block
 block discarded – undo
140 140
         if($users->isEmpty()) {
141 141
             $this->info('No users found.');
142 142
             return;
143
-        }
144
-        else {
143
+        } else {
145 144
             if(!$this->confirm('Do you want to restore ' . $users->count() . ' user(s)?')) {
146 145
                 return;
147 146
             }
@@ -152,8 +151,7 @@  discard block
 block discarded – undo
152 151
                 $this->authService->handle('restore', ['user' => $user]);
153 152
 
154 153
                 $this->info('User #' . $user->id . ' (' . $user->email . ') successfully restored.');
155
-            }
156
-            catch(\Exception $e) {
154
+            } catch(\Exception $e) {
157 155
                 $this->error('User #' . $user->id . ' (' . $user->email . ') cannot be restored. ' . $e->getMessage());
158 156
             }
159 157
         }
Please login to merge, or discard this patch.
src/Helpers/ArrayHelper.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,10 +23,10 @@
 block discarded – undo
23 23
         $keys = array_map('strtolower', $keys);
24 24
 
25 25
         foreach ($input as $key => $value) {
26
-            if(is_array($value)) {
26
+            if (is_array($value)) {
27 27
                 $input[$key] = static::replaceValuesByMatchingKeys($value, $keys, $replacement);
28 28
             }
29
-            elseif(is_string($key) && in_array(strtolower($key), $keys)) {
29
+            elseif (is_string($key) && in_array(strtolower($key), $keys)) {
30 30
                 $input[$key] = $replacement instanceof \Closure
31 31
                     ? $replacement($key, $value)
32 32
                     : $replacement;
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,8 +25,7 @@
 block discarded – undo
25 25
         foreach ($input as $key => $value) {
26 26
             if(is_array($value)) {
27 27
                 $input[$key] = static::replaceValuesByMatchingKeys($value, $keys, $replacement);
28
-            }
29
-            elseif(is_string($key) && in_array(strtolower($key), $keys)) {
28
+            } elseif(is_string($key) && in_array(strtolower($key), $keys)) {
30 29
                 $input[$key] = $replacement instanceof \Closure
31 30
                     ? $replacement($key, $value)
32 31
                     : $replacement;
Please login to merge, or discard this patch.
src/Client.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -380,7 +380,7 @@
 block discarded – undo
380 380
         $this->log(null, $decoded ?? []);
381 381
 
382 382
         if($this->success()) {
383
-           return $this->formatted;
383
+            return $this->formatted;
384 384
         }
385 385
 
386 386
         $message = array_get($this->formatted, 'message');
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -64,15 +64,15 @@  discard block
 block discarded – undo
64 64
      */
65 65
     protected function boot()
66 66
     {
67
-        if(!$publicKey = $this->credential('public')) {
67
+        if (!$publicKey = $this->credential('public')) {
68 68
             throw new \InvalidArgumentException('Public key must be defined');
69 69
         }
70 70
 
71
-        if(!$secretKey = $this->credential('secret')) {
71
+        if (!$secretKey = $this->credential('secret')) {
72 72
             throw new \InvalidArgumentException('Secret key must be defined');
73 73
         }
74 74
 
75
-        if(!$this->client) {
75
+        if (!$this->client) {
76 76
             $handler = new \GuzzleHttp\HandlerStack();
77 77
             $handler->setHandler(new \GuzzleHttp\Handler\CurlHandler());
78 78
             $handler->push($this->bearerTokenHeader());
@@ -275,11 +275,11 @@  discard block
 block discarded – undo
275 275
      */
276 276
     public function request(string $name, array $parameters = []): array
277 277
     {
278
-        if(!$this->hasRequest($name)) {
278
+        if (!$this->hasRequest($name)) {
279 279
             throw new \InvalidArgumentException("Request `{$name}` is not supported");
280 280
         }
281 281
 
282
-        if(!method_exists($this, $name)) {
282
+        if (!method_exists($this, $name)) {
283 283
             throw new \InvalidArgumentException("Request `{$name}` listed but is not implemented");
284 284
         }
285 285
 
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
      */
312 312
     public function success(bool $withStatus = false): bool
313 313
     {
314
-        if(!$this->response || $this->response->getStatusCode() !== 200) {
314
+        if (!$this->response || $this->response->getStatusCode() !== 200) {
315 315
             return false;
316 316
         }
317 317
 
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
 
380 380
         $this->log(null, $decoded ?? []);
381 381
 
382
-        if($this->success()) {
382
+        if ($this->success()) {
383 383
            return $this->formatted;
384 384
         }
385 385
 
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
      */
408 408
     private function bearerToken()
409 409
     {
410
-        if(!$token = app('auth')->token()) {
410
+        if (!$token = app('auth')->token()) {
411 411
             return null;
412 412
         }
413 413
 
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
     public function bearerTokenHeader(): \Closure
423 423
     {
424 424
         return function(callable $handler) {
425
-            return function (\Psr\Http\Message\RequestInterface $request, array $options) use ($handler) {
425
+            return function(\Psr\Http\Message\RequestInterface $request, array $options) use ($handler) {
426 426
                 $request = $request->withHeader('Authorization', $this->bearerToken());
427 427
 
428 428
                 return $handler($request, $options);
Please login to merge, or discard this patch.