Passed
Push — master ( 85c419...35703b )
by Arthur
07:22
created
config/horizon.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         'production' => [
75 75
             'supervisor-1' => [
76 76
                 'connection' => 'redis',
77
-                'queue'      => ['default'],
77
+                'queue'      => [ 'default' ],
78 78
                 'balance'    => 'simple',
79 79
                 'processes'  => 10,
80 80
                 'tries'      => 3,
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
         'local' => [
85 85
             'supervisor-1' => [
86 86
                 'connection' => 'redis',
87
-                'queue'      => ['default'],
87
+                'queue'      => [ 'default' ],
88 88
                 'balance'    => 'simple',
89 89
                 'processes'  => 3,
90 90
                 'tries'      => 3,
Please login to merge, or discard this patch.
src/Modules/Auth0/Http/Middleware/Auth0AuthenticationMiddleware.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -38,14 +38,14 @@
 block discarded – undo
38 38
             $user = $this->auth0Service->getUserByDecodedJWT($tokenInfo);
39 39
 
40 40
             if (!$user) {
41
-                return response()->json(['error' => 'Unauthorized user.'], 401);
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/Foundation/Abstracts/Models/SqlModel.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 {
15 15
     protected $connection = 'mysql';
16 16
 
17
-    public static function find($id, $columns = ['*'])
17
+    public static function find($id, $columns = [ '*' ])
18 18
     {
19 19
         if ((bool) config('model.caching')) {
20 20
             $model = ModelCache::findOrRequery($id, get_called_class());
@@ -25,14 +25,14 @@  discard block
 block discarded – undo
25 25
         return self::findWithoutCache($id, $columns);
26 26
     }
27 27
 
28
-    public static function findWithoutCache($id, $columns = ['*'])
28
+    public static function findWithoutCache($id, $columns = [ '*' ])
29 29
     {
30 30
         return parent::find($id, $columns);
31 31
     }
32 32
 
33 33
     private static function filterFromColumns($model, $columns)
34 34
     {
35
-        if ($columns !== ['*']) {
35
+        if ($columns !== [ '*' ]) {
36 36
             return collect($model)->first($columns);
37 37
         }
38 38
 
Please login to merge, or discard this patch.
src/Foundation/Cache/ModelCache.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
 
28 28
     public static function findOrRequery($id, $modelClass)
29 29
     {
30
-        return Cache::remember(self::getCacheName($id, $modelClass), self::getCacheTime(), function () use ($id, $modelClass) {
30
+        return Cache::remember(self::getCacheName($id, $modelClass), self::getCacheTime(), function() use ($id, $modelClass) {
31 31
             return $modelClass::findWithoutCache($id);
32 32
         });
33 33
     }
Please login to merge, or discard this patch.
src/Foundation/Services/BootstrapRegistrarService.php 1 patch
Spacing   +30 added lines, -30 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);
145
+                                        $bootstrap[ $key ][ ] = $this->buildRouteArray($directoryPath.'/'.$fileName, $namespace);
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
     /**
@@ -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
 
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
     private function buildPolicyArray($class, $namespace)
243 243
     {
244 244
         $moduleNamespace = $namespace;
245
-        $moduleName = explode('\\', $moduleNamespace)[1];
245
+        $moduleName = explode('\\', $moduleNamespace)[ 1 ];
246 246
         $modelNameSpace = $moduleNamespace.'\\'.'Entities\\'.$moduleName;
247 247
 
248 248
         return [
@@ -281,10 +281,10 @@  discard block
 block discarded – undo
281 281
     private function buildEventsArray($class)
282 282
     {
283 283
         $listenerProperties = get_class_property($class, 'listeners');
284
-        $listeners = [];
284
+        $listeners = [ ];
285 285
         foreach ($listenerProperties as $listener) {
286 286
             if (class_implements_interface($listener, ListenerContract::class)) {
287
-                $listeners[] = $listener;
287
+                $listeners[ ] = $listener;
288 288
             }
289 289
         }
290 290
 
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
      */
300 300
     public function getCommands(): array
301 301
     {
302
-        return $this->loadBootstrapFromCache()['commands'] ?? [];
302
+        return $this->loadBootstrapFromCache()[ 'commands' ] ?? [ ];
303 303
     }
304 304
 
305 305
     /**
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
      */
308 308
     public function getRoutes(): array
309 309
     {
310
-        return $this->loadBootstrapFromCache()['routes'] ?? [];
310
+        return $this->loadBootstrapFromCache()[ 'routes' ] ?? [ ];
311 311
     }
312 312
 
313 313
     /**
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
      */
316 316
     public function getConfigs(): array
317 317
     {
318
-        return $this->loadBootstrapFromCache()['configs'] ?? [];
318
+        return $this->loadBootstrapFromCache()[ 'configs' ] ?? [ ];
319 319
     }
320 320
 
321 321
     /**
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
      */
324 324
     public function getFactories(): array
325 325
     {
326
-        return $this->loadBootstrapFromCache()['factories'] ?? [];
326
+        return $this->loadBootstrapFromCache()[ 'factories' ] ?? [ ];
327 327
     }
328 328
 
329 329
     /**
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
      */
332 332
     public function getMigrations(): array
333 333
     {
334
-        return $this->loadBootstrapFromCache()['migrations'] ?? [];
334
+        return $this->loadBootstrapFromCache()[ 'migrations' ] ?? [ ];
335 335
     }
336 336
 
337 337
     /**
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
      */
340 340
     public function getSeeders(): array
341 341
     {
342
-        return $this->loadBootstrapFromCache()['seeders'] ?? [];
342
+        return $this->loadBootstrapFromCache()[ 'seeders' ] ?? [ ];
343 343
     }
344 344
 
345 345
     /**
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
      */
348 348
     public function getModels(): array
349 349
     {
350
-        return $this->loadBootstrapFromCache()['models'] ?? [];
350
+        return $this->loadBootstrapFromCache()[ 'models' ] ?? [ ];
351 351
     }
352 352
 
353 353
     /**
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
      */
356 356
     public function getPolicies(): array
357 357
     {
358
-        return $this->loadBootstrapFromCache()['policies'] ?? [];
358
+        return $this->loadBootstrapFromCache()[ 'policies' ] ?? [ ];
359 359
     }
360 360
 
361 361
     /**
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
      */
364 364
     public function getProviders(): array
365 365
     {
366
-        return $this->loadBootstrapFromCache()['providers'] ?? [];
366
+        return $this->loadBootstrapFromCache()[ 'providers' ] ?? [ ];
367 367
     }
368 368
 
369 369
     /**
@@ -371,6 +371,6 @@  discard block
 block discarded – undo
371 371
      */
372 372
     public function getEvents(): array
373 373
     {
374
-        return $this->loadBootstrapFromCache()['events'] ?? [];
374
+        return $this->loadBootstrapFromCache()[ 'events' ] ?? [ ];
375 375
     }
376 376
 }
Please login to merge, or discard this patch.
src/Foundation/Support/helpers.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
         }
43 43
         $randomIndex = random_int(0, count($array) - 1);
44 44
 
45
-        return $array[$randomIndex];
45
+        return $array[ $randomIndex ];
46 46
     }
47 47
 }
48 48
 if (!function_exists('create_multiple_from_factory')) {
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 
92 92
         $traits = array_flip(class_uses_recursive($class));
93 93
 
94
-        return isset($traits[$trait]);
94
+        return isset($traits[ $trait ]);
95 95
     }
96 96
 }
97 97
 if (!function_exists('array_keys_exists')) {
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 if (!function_exists('is_associative_array')) {
136 136
     function is_associative_array(array $arr)
137 137
     {
138
-        if ([] === $arr) {
138
+        if ([ ] === $arr) {
139 139
             return false;
140 140
         }
141 141
 
Please login to merge, or discard this patch.
src/Foundation/Models/MongoDatabaseNotification.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
      *
27 27
      * @var array
28 28
      */
29
-    protected $guarded = [];
29
+    protected $guarded = [ ];
30 30
     /**
31 31
      * The attributes that should be cast to native types.
32 32
      *
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     public function markAsRead()
54 54
     {
55 55
         if (is_null($this->read_at)) {
56
-            $this->forceFill(['read_at' => $this->freshTimestamp()])->save();
56
+            $this->forceFill([ 'read_at' => $this->freshTimestamp() ])->save();
57 57
         }
58 58
     }
59 59
 
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
      *
85 85
      * @return \Illuminate\Notifications\DatabaseNotificationCollection
86 86
      */
87
-    public function newCollection(array $models = [])
87
+    public function newCollection(array $models = [ ])
88 88
     {
89 89
         return new DatabaseNotificationCollection($models);
90 90
     }
Please login to merge, or discard this patch.
src/Foundation/Providers/BroadcastServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
     public function boot()
16 16
     {
17 17
         Broadcast::routes([
18
-            'middleware' => ['api'],
18
+            'middleware' => [ 'api' ],
19 19
             'domain'     => env('API_URL'),
20 20
         ]);
21 21
 
Please login to merge, or discard this patch.
src/Foundation/Providers/BootstrapServiceProvider.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -74,16 +74,16 @@  discard block
 block discarded – undo
74 74
     private function loadRoutes()
75 75
     {
76 76
         foreach ($this->bootstrapService->getRoutes() as $route) {
77
-            $path = $route['path'];
77
+            $path = $route[ 'path' ];
78 78
             Route::group([
79
-                'prefix'     => 'v1/'.str_plural($route['module']),
80
-                'namespace'  => $route['controller'],
81
-                'domain'     => $route['domain'],
82
-                'middleware' => ['api'],
83
-            ], function () use ($path) {
79
+                'prefix'     => 'v1/'.str_plural($route[ 'module' ]),
80
+                'namespace'  => $route[ 'controller' ],
81
+                'domain'     => $route[ 'domain' ],
82
+                'middleware' => [ 'api' ],
83
+            ], function() use ($path) {
84 84
                 require $path;
85 85
             });
86
-            Route::model($route['module'], $route['model']);
86
+            Route::model($route[ 'module' ], $route[ 'model' ]);
87 87
         }
88 88
     }
89 89
 
@@ -95,12 +95,12 @@  discard block
 block discarded – undo
95 95
     protected function loadConfigs()
96 96
     {
97 97
         foreach ($this->bootstrapService->getConfigs() as $config) {
98
-            if ($config['filename'] === 'config.php') {
98
+            if ($config[ 'filename' ] === 'config.php') {
99 99
                 $this->publishes([
100
-                    $config['path'] => config_path($config['module']),
100
+                    $config[ 'path' ] => config_path($config[ 'module' ]),
101 101
                 ], 'config');
102 102
                 $this->mergeConfigFrom(
103
-                    $config['path'], basename($config['module'], '.php')
103
+                    $config[ 'path' ], basename($config[ 'module' ], '.php')
104 104
                 );
105 105
             }
106 106
         }
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
     {
116 116
         foreach ($this->bootstrapService->getFactories() as $factory) {
117 117
             if (!$this->app->environment('production')) {
118
-                app(Factory::class)->load($factory['path']);
118
+                app(Factory::class)->load($factory[ 'path' ]);
119 119
             }
120 120
         }
121 121
     }
@@ -128,15 +128,15 @@  discard block
 block discarded – undo
128 128
     public function loadMigrations()
129 129
     {
130 130
         foreach ($this->bootstrapService->getMigrations() as $migration) {
131
-            $this->loadMigrationsFrom($migration['path']);
131
+            $this->loadMigrationsFrom($migration[ 'path' ]);
132 132
         }
133 133
     }
134 134
 
135 135
     private function loadPolicies()
136 136
     {
137 137
         foreach ($this->bootstrapService->getPolicies() as $policy) {
138
-            if (class_implements_interface($policy['class'], ModelPolicyContract::class)) {
139
-                Gate::policy($policy['model'], $policy['class']);
138
+            if (class_implements_interface($policy[ 'class' ], ModelPolicyContract::class)) {
139
+                Gate::policy($policy[ 'model' ], $policy[ 'class' ]);
140 140
             }
141 141
         }
142 142
     }
@@ -145,8 +145,8 @@  discard block
 block discarded – undo
145 145
     {
146 146
         $app = $this->app;
147 147
         $service = $this->bootstrapService;
148
-        $this->app->extend('command.seed', function () use ($app, $service) {
149
-            return new SeedCommand($app['db'], $service);
148
+        $this->app->extend('command.seed', function() use ($app, $service) {
149
+            return new SeedCommand($app[ 'db' ], $service);
150 150
         });
151 151
     }
152 152
 
@@ -179,8 +179,8 @@  discard block
 block discarded – undo
179 179
     private function loadListeners()
180 180
     {
181 181
         foreach ($this->bootstrapService->getEvents() as $event) {
182
-            foreach ($event['listeners'] as $listener) {
183
-                Event::listen($event['class'], $listener);
182
+            foreach ($event[ 'listeners' ] as $listener) {
183
+                Event::listen($event[ 'class' ], $listener);
184 184
             }
185 185
         }
186 186
     }
Please login to merge, or discard this patch.