Completed
Pull Request — master (#1)
by Artem
03:18
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/Client.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -353,7 +353,7 @@
 block discarded – undo
353 353
         \Illuminate\Support\Facades\Log::debug(null, $decoded ?? []);
354 354
 
355 355
         if($this->success()) {
356
-           return $this->formatted;
356
+            return $this->formatted;
357 357
         }
358 358
 
359 359
         $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
@@ -61,15 +61,15 @@  discard block
 block discarded – undo
61 61
      */
62 62
     protected function boot()
63 63
     {
64
-        if(!$publicKey = $this->credential('public')) {
64
+        if (!$publicKey = $this->credential('public')) {
65 65
             throw new \InvalidArgumentException('Public key must be defined');
66 66
         }
67 67
 
68
-        if(!$secretKey = $this->credential('secret')) {
68
+        if (!$secretKey = $this->credential('secret')) {
69 69
             throw new \InvalidArgumentException('Secret key must be defined');
70 70
         }
71 71
 
72
-        if(!$this->client) {
72
+        if (!$this->client) {
73 73
             $handler = new \GuzzleHttp\HandlerStack();
74 74
             $handler->setHandler(new \GuzzleHttp\Handler\CurlHandler());
75 75
             $handler->push($this->bearerTokenHeader());
@@ -248,11 +248,11 @@  discard block
 block discarded – undo
248 248
      */
249 249
     public function request(string $name, array $parameters = []): array
250 250
     {
251
-        if(!$this->hasRequest($name)) {
251
+        if (!$this->hasRequest($name)) {
252 252
             throw new \InvalidArgumentException("Request `{$name}` is not supported");
253 253
         }
254 254
 
255
-        if(!method_exists($this, $name)) {
255
+        if (!method_exists($this, $name)) {
256 256
             throw new \InvalidArgumentException("Request `{$name}` listed but is not implemented");
257 257
         }
258 258
         
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
      */
285 285
     public function success(bool $withStatus = false): bool
286 286
     {
287
-        if(!$this->response || $this->response->getStatusCode() !== 200) {
287
+        if (!$this->response || $this->response->getStatusCode() !== 200) {
288 288
             return false;
289 289
         }
290 290
 
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
 
353 353
         \Illuminate\Support\Facades\Log::debug(null, $decoded ?? []);
354 354
 
355
-        if($this->success()) {
355
+        if ($this->success()) {
356 356
            return $this->formatted;
357 357
         }
358 358
 
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
      */
381 381
     private function bearerToken()
382 382
     {
383
-        if(!$token = app('auth')->token()) {
383
+        if (!$token = app('auth')->token()) {
384 384
             return null;
385 385
         }
386 386
 
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
     public function bearerTokenHeader(): \Closure
396 396
     {
397 397
         return function(callable $handler) {
398
-            return function (\Psr\Http\Message\RequestInterface $request, array $options) use ($handler) {
398
+            return function(\Psr\Http\Message\RequestInterface $request, array $options) use ($handler) {
399 399
                 $request = $request->withHeader('Authorization', $this->bearerToken());
400 400
 
401 401
                 return $handler($request, $options);
Please login to merge, or discard this patch.
src/Webhooks/Dispatcher.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,20 +22,20 @@
 block discarded – undo
22 22
      */
23 23
     public function handle(string $key, array $payload)
24 24
     {
25
-        if(!$this->has($key)) {
25
+        if (!$this->has($key)) {
26 26
             throw new WebhookException("Webhook with key \"{$key}\" cannot be found.");
27 27
         }
28 28
 
29 29
         $webhook = $this->instantiate($key, $payload);
30 30
 
31
-        if(!$webhook->validate()) {
31
+        if (!$webhook->validate()) {
32 32
             throw new WebhookValidationException($webhook->getValidator());
33 33
         }
34 34
 
35 35
         try {
36 36
             $webhook->handle();
37 37
         }
38
-        catch(\Exception $e) {
38
+        catch (\Exception $e) {
39 39
             throw new WebhookException(get_class($webhook) . ': ' . $e->getMessage());
40 40
         }
41 41
     }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,8 +34,7 @@
 block discarded – undo
34 34
 
35 35
         try {
36 36
             $webhook->handle();
37
-        }
38
-        catch(\Exception $e) {
37
+        } catch(\Exception $e) {
39 38
             throw new WebhookException(get_class($webhook) . ': ' . $e->getMessage());
40 39
         }
41 40
     }
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.