Passed
Push — master ( 7989cd...44fe88 )
by Arthur
17:19 queued 12:00
created
src/Modules/Auth0/Http/Middleware/Auth0AuthenticationMiddleware.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -37,15 +37,15 @@
 block discarded – undo
37 37
             $tokenInfo = $auth0->decodeJWT($accessToken);
38 38
             $user = $this->auth0Service->getUserByDecodedJWT($tokenInfo);
39 39
 
40
-            if (! $user) {
41
-                return response()->json(['error' => 'Unauthorized user.'], 401);
40
+            if (!$user) {
41
+                return response()->json([ 'error' => 'Unauthorized user.' ], 401);
42 42
             }
43 43
 
44 44
             \Auth::login($user);
45 45
         } catch (InvalidTokenException $e) {
46
-            return response()->json(['error' => 'Invalid or no token set.'], 401);
46
+            return response()->json([ 'error' => 'Invalid or no token set.' ], 401);
47 47
         } catch (CoreException $e) {
48
-            return response()->json(['error' => $e->getMessage()], 401);
48
+            return response()->json([ 'error' => $e->getMessage() ], 401);
49 49
         }
50 50
 
51 51
         return $next($request);
Please login to merge, or discard this patch.
src/Modules/Auth0/Services/Auth0Service.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -49,17 +49,17 @@  discard block
 block discarded – undo
49 49
 
50 50
     public function getUserByUserInfo($userInfo)
51 51
     {
52
-        return $this->upsertUser($userInfo['profile']);
52
+        return $this->upsertUser($userInfo[ 'profile' ]);
53 53
     }
54 54
 
55 55
     protected function upsertUser($profile)
56 56
     {
57
-        if (! isset($profile->user_id)) {
57
+        if (!isset($profile->user_id)) {
58 58
             throw new BadRequestHttpException('Missing token information: Auth0 user id is not set');
59 59
         }
60 60
         $identifier = explode('|', $profile->user_id);
61
-        $identityProvider = $identifier[0];
62
-        $id = $identifier[1];
61
+        $identityProvider = $identifier[ 0 ];
62
+        $id = $identifier[ 1 ];
63 63
 
64 64
         $user = $this->service->findByIdentityId($id);
65 65
         if ($user === null) {
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 
96 96
     public function getTestUserToken()
97 97
     {
98
-        return Cache::remember('testing:http_access_token', 60, function () {
98
+        return Cache::remember('testing:http_access_token', 60, function() {
99 99
             try {
100 100
                 $httpClient = new Client();
101 101
                 $response = $httpClient->post(env('AUTH0_DOMAIN').'oauth/token', [
Please login to merge, or discard this patch.
src/Modules/Auth0/Drivers/Auth0UserProfileStorageDriver.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
     {
77 77
         $this->loadServices();
78 78
 
79
-        if (! $this->validator->validate($this->profile)) {
79
+        if (!$this->validator->validate($this->profile)) {
80 80
             throw new UnauthorizedException('Invalid profile data found in the access token');
81 81
         }
82 82
     }
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
         $profile = $this->transformer->transformProfile($this->profile);
112 112
 
113 113
         if ($this->profileHasChanged()) {
114
-            $profile['provider'] = $this->identityProvider;
114
+            $profile[ 'provider' ] = $this->identityProvider;
115 115
             $this->user->fill($profile);
116 116
             $this->user->save();
117 117
         }
@@ -124,6 +124,6 @@  discard block
 block discarded – undo
124 124
         $user = $this->user->toArray();
125 125
         $profile = (array) $this->profile;
126 126
 
127
-        return ! array_is_subset_of($profile, $user);
127
+        return !array_is_subset_of($profile, $user);
128 128
     }
129 129
 }
Please login to merge, or discard this patch.
src/Modules/Mongo/Abstracts/MongoCollectionMigration.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
      */
28 28
     public function __construct()
29 29
     {
30
-        if (! isset($this->collection) || $this->collection === '') {
30
+        if (!isset($this->collection) || $this->collection === '') {
31 31
             throw new InternalErrorException('Collection name must be specified on migration: '.get_called_class());
32 32
         }
33 33
     }
@@ -39,8 +39,8 @@  discard block
 block discarded – undo
39 39
      */
40 40
     final public function up()
41 41
     {
42
-        if (! Schema::connection($this->connection)->hasTable($this->collection)) {
43
-            Schema::connection($this->connection)->create($this->collection, function (Blueprint $collection) {
42
+        if (!Schema::connection($this->connection)->hasTable($this->collection)) {
43
+            Schema::connection($this->connection)->create($this->collection, function(Blueprint $collection) {
44 44
                 if (method_exists($this, 'migrate')) {
45 45
                     $this->migrate($collection);
46 46
                 }
Please login to merge, or discard this patch.
src/Modules/User/Services/UserService.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -64,8 +64,8 @@
 block discarded – undo
64 64
 
65 65
     public function setRoles($id, array $roles): void
66 66
     {
67
-        if (! in_array(Role::USER, $roles)) {
68
-            $roles[] = Role::USER;
67
+        if (!in_array(Role::USER, $roles)) {
68
+            $roles[ ] = Role::USER;
69 69
         }
70 70
         $this->find($id)->syncRoles($roles);
71 71
     }
Please login to merge, or discard this patch.
src/Foundation/Providers/BootstrapServiceProvider.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
     {
65 65
         $this->bootstrapService = new BootstrapRegistrarService();
66 66
 
67
-        if (! ($this->app->environment('production') || $this->app->environment('testing'))) {
67
+        if (!($this->app->environment('production') || $this->app->environment('testing'))) {
68 68
             $this->bootstrapService->recache();
69 69
         }
70 70
     }
@@ -77,10 +77,10 @@  discard block
 block discarded – undo
77 77
     private function loadRoutes()
78 78
     {
79 79
         foreach ($this->bootstrapService->getRoutes() as $route) {
80
-            $path = $route['path'];
81
-            $fileNameArray = explode('.', $route['filename']);
82
-            $routePrefix = $fileNameArray[0];
83
-            $version = $fileNameArray[1];
80
+            $path = $route[ 'path' ];
81
+            $fileNameArray = explode('.', $route[ 'filename' ]);
82
+            $routePrefix = $fileNameArray[ 0 ];
83
+            $version = $fileNameArray[ 1 ];
84 84
 
85 85
             if ($version === 'php') {
86 86
                 $prefix = $routePrefix;
@@ -90,13 +90,13 @@  discard block
 block discarded – undo
90 90
 
91 91
             Route::group([
92 92
                 'prefix'     => $prefix,
93
-                'namespace'  => $route['controller'],
94
-                'domain'     => $route['domain'],
95
-                'middleware' => ['api'],
96
-            ], function () use ($path) {
93
+                'namespace'  => $route[ 'controller' ],
94
+                'domain'     => $route[ 'domain' ],
95
+                'middleware' => [ 'api' ],
96
+            ], function() use ($path) {
97 97
                 require $path;
98 98
             });
99
-            Route::model($route['module'], $route['model']);
99
+            Route::model($route[ 'module' ], $route[ 'model' ]);
100 100
         }
101 101
     }
102 102
 
@@ -108,11 +108,11 @@  discard block
 block discarded – undo
108 108
     protected function loadConfigs()
109 109
     {
110 110
         foreach ($this->bootstrapService->getConfigs() as $config) {
111
-            if (isset($config['filename']) && is_string($config['filename'])) {
112
-                $fileName = $config['filename'];
113
-                $configName = strtolower(explode('.', $fileName)[0]);
111
+            if (isset($config[ 'filename' ]) && is_string($config[ 'filename' ])) {
112
+                $fileName = $config[ 'filename' ];
113
+                $configName = strtolower(explode('.', $fileName)[ 0 ]);
114 114
                 $this->mergeConfigFrom(
115
-                    $config['path'], $configName
115
+                    $config[ 'path' ], $configName
116 116
                 );
117 117
             }
118 118
         }
@@ -126,8 +126,8 @@  discard block
 block discarded – undo
126 126
     public function loadFactories()
127 127
     {
128 128
         foreach ($this->bootstrapService->getFactories() as $factory) {
129
-            if (! $this->app->environment('production')) {
130
-                app(Factory::class)->load($factory['path']);
129
+            if (!$this->app->environment('production')) {
130
+                app(Factory::class)->load($factory[ 'path' ]);
131 131
             }
132 132
         }
133 133
     }
@@ -140,15 +140,15 @@  discard block
 block discarded – undo
140 140
     public function loadMigrations()
141 141
     {
142 142
         foreach ($this->bootstrapService->getMigrations() as $migration) {
143
-            $this->loadMigrationsFrom($migration['path']);
143
+            $this->loadMigrationsFrom($migration[ 'path' ]);
144 144
         }
145 145
     }
146 146
 
147 147
     private function loadPolicies()
148 148
     {
149 149
         foreach ($this->bootstrapService->getPolicies() as $policy) {
150
-            if (class_implements_interface($policy['class'], ModelPolicyContract::class)) {
151
-                Gate::policy($policy['model'], $policy['class']);
150
+            if (class_implements_interface($policy[ 'class' ], ModelPolicyContract::class)) {
151
+                Gate::policy($policy[ 'model' ], $policy[ 'class' ]);
152 152
             }
153 153
         }
154 154
     }
@@ -157,8 +157,8 @@  discard block
 block discarded – undo
157 157
     {
158 158
         $app = $this->app;
159 159
         $service = $this->bootstrapService;
160
-        $this->app->extend('command.seed', function () use ($app, $service) {
161
-            return new SeedCommand($app['db'], $service);
160
+        $this->app->extend('command.seed', function() use ($app, $service) {
161
+            return new SeedCommand($app[ 'db' ], $service);
162 162
         });
163 163
     }
164 164
 
@@ -193,15 +193,15 @@  discard block
 block discarded – undo
193 193
     private function loadListeners()
194 194
     {
195 195
         foreach ($this->bootstrapService->getEvents() as $event) {
196
-            foreach ($event['listeners'] as $listener) {
197
-                Event::listen($event['class'], $listener);
196
+            foreach ($event[ 'listeners' ] as $listener) {
197
+                Event::listen($event[ 'class' ], $listener);
198 198
             }
199 199
         }
200 200
     }
201 201
 
202 202
     private function passedRegistrationCondition($class)
203 203
     {
204
-        if (! class_implements_interface($class, ConditionalAutoRegistration::class)) {
204
+        if (!class_implements_interface($class, ConditionalAutoRegistration::class)) {
205 205
             return true;
206 206
         }
207 207
 
Please login to merge, or discard this patch.
src/Foundation/Traits/Cacheable.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,14 +23,14 @@  discard block
 block discarded – undo
23 23
 
24 24
     public static function cache(): ModelCache
25 25
     {
26
-        if (! isset(static::$caching)) {
26
+        if (!isset(static::$caching)) {
27 27
             static::$caching = new ModelCache(static::class, get_class_property(static::class, 'secondaryCacheIndexes'), get_class_property(static::class, 'cacheTime'));
28 28
         }
29 29
 
30 30
         return static::$caching;
31 31
     }
32 32
 
33
-    public static function find($id, $columns = ['*'])
33
+    public static function find($id, $columns = [ '*' ])
34 34
     {
35 35
         if (static::cache()->enabled()) {
36 36
             $model = static::cache()->find($id) ?? static::recache($id);
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
         return $model;
50 50
     }
51 51
 
52
-    public static function findWithoutCache($id, $columns = ['*'])
52
+    public static function findWithoutCache($id, $columns = [ '*' ])
53 53
     {
54 54
         $model = new static();
55 55
         if (is_array($id) || $id instanceof Arrayable) {
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
             return;
66 66
         }
67 67
 
68
-        if ($columns !== ['*']) {
68
+        if ($columns !== [ '*' ]) {
69 69
             return collect($model)->first($columns);
70 70
         }
71 71
 
Please login to merge, or discard this patch.
src/Foundation/Services/BootstrapRegistrarService.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -88,9 +88,9 @@  discard block
 block discarded – undo
88 88
      */
89 89
     private function buildEmptyBootstrapArray()
90 90
     {
91
-        $bootstrapArray = [];
91
+        $bootstrapArray = [ ];
92 92
         foreach ($this->moduleEntityDirectories as $key => $directory) {
93
-            $bootstrapArray[$key] = [];
93
+            $bootstrapArray[ $key ] = [ ];
94 94
         }
95 95
 
96 96
         return $bootstrapArray;
@@ -102,10 +102,10 @@  discard block
 block discarded – undo
102 102
     private function getModules(): array
103 103
     {
104 104
         $path = base_path('src/Modules');
105
-        $moduleNames = array_diff(scandir($path), ['..', '.']);
106
-        $modules = [];
105
+        $moduleNames = array_diff(scandir($path), [ '..', '.' ]);
106
+        $modules = [ ];
107 107
         foreach ($moduleNames as $moduleName) {
108
-            $modules[$moduleName] = $path.'/'.$moduleName;
108
+            $modules[ $moduleName ] = $path.'/'.$moduleName;
109 109
         }
110 110
 
111 111
         return $modules;
@@ -135,38 +135,38 @@  discard block
 block discarded – undo
135 135
                                         try {
136 136
                                             $command = new $class();
137 137
                                             if ($command instanceof Command) {
138
-                                                $bootstrap[$key][] = $class;
138
+                                                $bootstrap[ $key ][ ] = $class;
139 139
                                             }
140 140
                                         } catch (\Exception $e) {
141 141
                                             break;
142 142
                                         }
143 143
                                         break;
144 144
                                     case 'routes':
145
-                                        $bootstrap[$key][] = $this->buildRouteArray($directoryPath.'/'.$fileName, $namespace, $fileName);
145
+                                        $bootstrap[ $key ][ ] = $this->buildRouteArray($directoryPath.'/'.$fileName, $namespace, $fileName);
146 146
                                         break;
147 147
                                     case 'configs':
148
-                                        $bootstrap[$key][] = $this->buildConfigArray($directoryPath.'/'.$fileName, $moduleName, $fileName);
148
+                                        $bootstrap[ $key ][ ] = $this->buildConfigArray($directoryPath.'/'.$fileName, $moduleName, $fileName);
149 149
                                         break;
150 150
                                     case 'factories':
151
-                                        $bootstrap[$key][] = $this->buildDirectoryPathArray($directoryPath);
151
+                                        $bootstrap[ $key ][ ] = $this->buildDirectoryPathArray($directoryPath);
152 152
                                         break;
153 153
                                     case 'migrations':
154
-                                        $bootstrap[$key][] = $this->buildDirectoryPathArray($directoryPath);
154
+                                        $bootstrap[ $key ][ ] = $this->buildDirectoryPathArray($directoryPath);
155 155
                                         break;
156 156
                                     case 'seeders':
157
-                                        $bootstrap[$key][] = $class;
157
+                                        $bootstrap[ $key ][ ] = $class;
158 158
                                         break;
159 159
                                     case 'models':
160
-                                        $bootstrap[$key][] = $class;
160
+                                        $bootstrap[ $key ][ ] = $class;
161 161
                                         break;
162 162
                                     case 'policies':
163
-                                        $bootstrap[$key][] = $this->buildPolicyArray($class, $namespace);
163
+                                        $bootstrap[ $key ][ ] = $this->buildPolicyArray($class, $namespace);
164 164
                                         break;
165 165
                                     case 'providers':
166
-                                        $bootstrap[$key][] = $class;
166
+                                        $bootstrap[ $key ][ ] = $class;
167 167
                                         break;
168 168
                                     case 'events':
169
-                                        $bootstrap[$key][] = $this->buildEventsArray($class);
169
+                                        $bootstrap[ $key ][ ] = $this->buildEventsArray($class);
170 170
                                         break;
171 171
                                     default:
172 172
                                         break;
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
      */
189 189
     private function hasPhpExtension(string $fileName): bool
190 190
     {
191
-        return strlen($fileName) > 4 && '.php' === ($fileName[-4].$fileName[-3].$fileName[-2].$fileName[-1]);
191
+        return strlen($fileName) > 4 && '.php' === ($fileName[-4 ].$fileName[-3 ].$fileName[-2 ].$fileName[-1 ]);
192 192
     }
193 193
 
194 194
     /**
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
      */
197 197
     public function loadBootstrapFromCache()
198 198
     {
199
-        if (! isset($this->bootstrap)) {
199
+        if (!isset($this->bootstrap)) {
200 200
             if ($this->cacheExists()) {
201 201
                 $this->bootstrap = $this->readFromCache();
202 202
             } else {
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
         $apiDomain = str_replace('http://', '', $apiDomain);
220 220
         $apiDomain = str_replace('https://', '', $apiDomain);
221 221
         $moduleNamespace = $namespace;
222
-        $moduleName = explode('\\', $moduleNamespace)[1];
222
+        $moduleName = explode('\\', $moduleNamespace)[ 1 ];
223 223
         $controllerNamespace = $moduleNamespace.'\\'.'Http\\Controllers';
224 224
         $modelNameSpace = $moduleNamespace.'\\'.'Entities\\'.$moduleName;
225 225
 
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
     private function buildPolicyArray($class, $namespace)
244 244
     {
245 245
         $moduleNamespace = $namespace;
246
-        $moduleName = explode('\\', $moduleNamespace)[1];
246
+        $moduleName = explode('\\', $moduleNamespace)[ 1 ];
247 247
         $modelNameSpace = $moduleNamespace.'\\'.'Entities\\'.$moduleName;
248 248
 
249 249
         return [
@@ -281,11 +281,11 @@  discard block
 block discarded – undo
281 281
 
282 282
     private function buildEventsArray($class)
283 283
     {
284
-        $listenerProperties = get_class_property($class, 'listeners') ?? [];
285
-        $listeners = [];
284
+        $listenerProperties = get_class_property($class, 'listeners') ?? [ ];
285
+        $listeners = [ ];
286 286
         foreach ($listenerProperties as $listener) {
287 287
             if (class_implements_interface($listener, ListenerContract::class)) {
288
-                $listeners[] = $listener;
288
+                $listeners[ ] = $listener;
289 289
             }
290 290
         }
291 291
 
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
      */
301 301
     public function getCommands(): array
302 302
     {
303
-        return $this->loadBootstrapFromCache()['commands'] ?? [];
303
+        return $this->loadBootstrapFromCache()[ 'commands' ] ?? [ ];
304 304
     }
305 305
 
306 306
     /**
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
      */
309 309
     public function getRoutes(): array
310 310
     {
311
-        return $this->loadBootstrapFromCache()['routes'] ?? [];
311
+        return $this->loadBootstrapFromCache()[ 'routes' ] ?? [ ];
312 312
     }
313 313
 
314 314
     /**
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
      */
317 317
     public function getConfigs(): array
318 318
     {
319
-        return $this->loadBootstrapFromCache()['configs'] ?? [];
319
+        return $this->loadBootstrapFromCache()[ 'configs' ] ?? [ ];
320 320
     }
321 321
 
322 322
     /**
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
      */
325 325
     public function getFactories(): array
326 326
     {
327
-        return $this->loadBootstrapFromCache()['factories'] ?? [];
327
+        return $this->loadBootstrapFromCache()[ 'factories' ] ?? [ ];
328 328
     }
329 329
 
330 330
     /**
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
      */
333 333
     public function getMigrations(): array
334 334
     {
335
-        return $this->loadBootstrapFromCache()['migrations'] ?? [];
335
+        return $this->loadBootstrapFromCache()[ 'migrations' ] ?? [ ];
336 336
     }
337 337
 
338 338
     /**
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
      */
341 341
     public function getSeeders(): array
342 342
     {
343
-        return $this->loadBootstrapFromCache()['seeders'] ?? [];
343
+        return $this->loadBootstrapFromCache()[ 'seeders' ] ?? [ ];
344 344
     }
345 345
 
346 346
     /**
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
      */
349 349
     public function getModels(): array
350 350
     {
351
-        return $this->loadBootstrapFromCache()['models'] ?? [];
351
+        return $this->loadBootstrapFromCache()[ 'models' ] ?? [ ];
352 352
     }
353 353
 
354 354
     /**
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
      */
357 357
     public function getPolicies(): array
358 358
     {
359
-        return $this->loadBootstrapFromCache()['policies'] ?? [];
359
+        return $this->loadBootstrapFromCache()[ 'policies' ] ?? [ ];
360 360
     }
361 361
 
362 362
     /**
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
      */
365 365
     public function getProviders(): array
366 366
     {
367
-        return $this->loadBootstrapFromCache()['providers'] ?? [];
367
+        return $this->loadBootstrapFromCache()[ 'providers' ] ?? [ ];
368 368
     }
369 369
 
370 370
     /**
@@ -372,6 +372,6 @@  discard block
 block discarded – undo
372 372
      */
373 373
     public function getEvents(): array
374 374
     {
375
-        return $this->loadBootstrapFromCache()['events'] ?? [];
375
+        return $this->loadBootstrapFromCache()[ 'events' ] ?? [ ];
376 376
     }
377 377
 }
Please login to merge, or discard this patch.
src/Foundation/Console/SeedCommand.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -28,16 +28,16 @@  discard block
 block discarded – undo
28 28
      */
29 29
     public function handle()
30 30
     {
31
-        if (! $this->confirmToProceed()) {
31
+        if (!$this->confirmToProceed()) {
32 32
             return;
33 33
         }
34 34
 
35 35
         $this->resolver->setDefaultConnection($this->getDatabase());
36 36
 
37
-        Model::unguarded(function () {
37
+        Model::unguarded(function() {
38 38
             foreach ($this->getSeeders() as $seeder) {
39 39
                 $seeder = $this->laravel->make($seeder);
40
-                if (! isset($seeder->enabled) || $seeder->enabled) {
40
+                if (!isset($seeder->enabled) || $seeder->enabled) {
41 41
                     $seeder->__invoke();
42 42
                 }
43 43
             }
@@ -50,6 +50,6 @@  discard block
 block discarded – undo
50 50
     {
51 51
         $this->service = $this->laravel->make(BootstrapRegistrarService::class);
52 52
 
53
-        return $this->service->getSeeders() ?? [];
53
+        return $this->service->getSeeders() ?? [ ];
54 54
     }
55 55
 }
Please login to merge, or discard this patch.