Passed
Push — master ( e5b31a...cf340d )
by Arthur
04:48
created
src/Foundation/Routes/channels.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,6 +11,6 @@
 block discarded – undo
11 11
 |
12 12
 */
13 13
 
14
-Broadcast::channel('user.{id}', function ($user, $id) {
15
-    return $user->identity_id ===  $id;
14
+Broadcast::channel('user.{id}', function($user, $id) {
15
+    return $user->identity_id === $id;
16 16
 });
Please login to merge, or discard this patch.
src/Foundation/Abstracts/Tests/HttpTest.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -44,10 +44,10 @@  discard block
 block discarded – undo
44 44
 
45 45
     private function getUserTokenData(): \stdClass
46 46
     {
47
-        return Cache::remember('testing:http_access_token', 60, function () {
47
+        return Cache::remember('testing:http_access_token', 60, function() {
48 48
             try {
49 49
                 $httpClient = new Client();
50
-                $response = $httpClient->post(config('laravel-auth0.domain') . 'oauth/token', [
50
+                $response = $httpClient->post(config('laravel-auth0.domain').'oauth/token', [
51 51
                     'form_params' => [
52 52
                         'grant_type' => 'password',
53 53
                         'client_id' => env('AUTH0_CLIENT_ID'),
@@ -64,22 +64,22 @@  discard block
 block discarded – undo
64 64
     }
65 65
 
66 66
     protected function decodeHttpContent($content) {
67
-        return json_decode($content,true)['data'];
67
+        return json_decode($content, true)[ 'data' ];
68 68
     }
69 69
 
70
-    protected function http(string $method, string $route, array $payload = [])
70
+    protected function http(string $method, string $route, array $payload = [ ])
71 71
     {
72 72
         return $this->sendRequest($method, $route, $payload, true);
73 73
     }
74 74
 
75
-    private function sendRequest(string $method, string $route, array $payload = [], $authenticated = true): \Illuminate\Foundation\Testing\TestResponse
75
+    private function sendRequest(string $method, string $route, array $payload = [ ], $authenticated = true): \Illuminate\Foundation\Testing\TestResponse
76 76
     {
77
-        return $this->json($method, env('API_URL') . '/' . $route, $payload, $authenticated ? [
78
-            'Authorization' => 'Bearer ' . $this->getUserTokenData()->id_token,
79
-        ] : []);
77
+        return $this->json($method, env('API_URL').'/'.$route, $payload, $authenticated ? [
78
+            'Authorization' => 'Bearer '.$this->getUserTokenData()->id_token,
79
+        ] : [ ]);
80 80
     }
81 81
 
82
-    protected function httpNoAuth(string $method, string $route, array $payload = [])
82
+    protected function httpNoAuth(string $method, string $route, array $payload = [ ])
83 83
     {
84 84
         return $this->sendRequest($method, $route, $payload, false);
85 85
     }
Please login to merge, or discard this patch.
src/Foundation/Cache/ModelCache.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 
29 29
     public static function findOrRequery($id, $modelClass)
30 30
     {
31
-        return Cache::remember(self::getCacheName($id, $modelClass), self::getCacheTime(),function () use ($id, $modelClass) {
31
+        return Cache::remember(self::getCacheName($id, $modelClass), self::getCacheTime(), function() use ($id, $modelClass) {
32 32
             return $modelClass::findWithoutCache($id);
33 33
         });
34 34
     }
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
      */
39 39
     public static function getCacheName($id, $modelClass)
40 40
     {
41
-        return config('model.cache_prefix') . ':' . strtolower(get_short_class_name($modelClass)) . ':' . $id;
41
+        return config('model.cache_prefix').':'.strtolower(get_short_class_name($modelClass)).':'.$id;
42 42
     }
43 43
 
44 44
     /**
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
     private static function deleteWithPrefix($prefix)
94 94
     {
95 95
         $redis = self::getCacheConnection();
96
-        $keyPattern = Cache::getPrefix() . $prefix . '*';
96
+        $keyPattern = Cache::getPrefix().$prefix.'*';
97 97
         $keys = $redis->keys($keyPattern);
98 98
         $redis->delete($keys);
99 99
     }
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
      */
120 120
     public static function clearModel($modelClass)
121 121
     {
122
-        $pattern = config('model.cache_prefix') . ':' . strtolower(get_short_class_name($modelClass));
122
+        $pattern = config('model.cache_prefix').':'.strtolower(get_short_class_name($modelClass));
123 123
         self::deleteWithPrefix($pattern);
124 124
     }
125 125
 }
Please login to merge, or discard this patch.
src/Foundation/Services/BootstrapRegistrarService.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
      */
55 55
     private function storeInCache($data)
56 56
     {
57
-        file_put_contents($this->getCachePath(), '<?php return ' . var_export($data, true) . ';');
57
+        file_put_contents($this->getCachePath(), '<?php return '.var_export($data, true).';');
58 58
     }
59 59
 
60 60
     /**
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
      */
84 84
     private function getCachePath(): string
85 85
     {
86
-        return app()->bootstrapPath() . '/cache/' . $this->cacheFile;
86
+        return app()->bootstrapPath().'/cache/'.$this->cacheFile;
87 87
     }
88 88
 
89 89
     /**
@@ -91,9 +91,9 @@  discard block
 block discarded – undo
91 91
      */
92 92
     private function buildEmptyBootstrapArray()
93 93
     {
94
-        $bootstrapArray = [];
94
+        $bootstrapArray = [ ];
95 95
         foreach ($this->moduleEntityDirectories as $key => $directory) {
96
-            $bootstrapArray[$key] = [];
96
+            $bootstrapArray[ $key ] = [ ];
97 97
         }
98 98
 
99 99
         return $bootstrapArray;
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
         $moduleNames = array_diff(scandir($path), array('..', '.'));
109 109
         $modules = array();
110 110
         foreach ($moduleNames as $moduleName) {
111
-            $modules[$moduleName] = $path . '/' . $moduleName;
111
+            $modules[ $moduleName ] = $path.'/'.$moduleName;
112 112
         }
113 113
         return $modules;
114 114
     }
@@ -124,51 +124,51 @@  discard block
 block discarded – undo
124 124
             if (is_dir($modulePath)) {
125 125
                 foreach ($this->moduleEntityDirectories as $key => $directory) {
126 126
                     $directory = ucfirst($directory);
127
-                    $directoryPath = $modulePath . '/' . $directory;
128
-                    $namespace = 'Modules' . '\\' . $moduleName;
127
+                    $directoryPath = $modulePath.'/'.$directory;
128
+                    $namespace = 'Modules'.'\\'.$moduleName;
129 129
                     if (is_dir($directoryPath)) {
130 130
                         $files = scandir($directoryPath);
131 131
                         foreach ($files as $fileName) {
132 132
                             if ($this->hasPhpExtension($fileName)) {
133 133
                                 $className = basename($fileName, '.php');
134
-                                $class = $namespace . '\\' . str_replace('/', '\\', $directory) . '\\' . $className;
134
+                                $class = $namespace.'\\'.str_replace('/', '\\', $directory).'\\'.$className;
135 135
                                 switch ($key) {
136 136
                                     case 'commands':
137 137
                                         try {
138 138
                                             $command = new $class();
139 139
                                             if ($command instanceof Command) {
140
-                                                $bootstrap[$key][] = $class;
140
+                                                $bootstrap[ $key ][ ] = $class;
141 141
                                             }
142 142
                                         } catch (\Exception $e) {
143 143
                                             break;
144 144
                                         }
145 145
                                         break;
146 146
                                     case 'routes':
147
-                                        $bootstrap[$key][] = $this->buildRouteArray($directoryPath . '/' . $fileName, $namespace);
147
+                                        $bootstrap[ $key ][ ] = $this->buildRouteArray($directoryPath.'/'.$fileName, $namespace);
148 148
                                         break;
149 149
                                     case 'configs':
150
-                                        $bootstrap[$key][] = $this->buildConfigArray($directoryPath . '/' . $fileName, $moduleName, $fileName);
150
+                                        $bootstrap[ $key ][ ] = $this->buildConfigArray($directoryPath.'/'.$fileName, $moduleName, $fileName);
151 151
                                         break;
152 152
                                     case 'factories':
153
-                                        $bootstrap[$key][] = $this->buildDirectoryPathArray($directoryPath);
153
+                                        $bootstrap[ $key ][ ] = $this->buildDirectoryPathArray($directoryPath);
154 154
                                         break;
155 155
                                     case 'migrations':
156
-                                        $bootstrap[$key][] = $this->buildDirectoryPathArray($directoryPath);
156
+                                        $bootstrap[ $key ][ ] = $this->buildDirectoryPathArray($directoryPath);
157 157
                                         break;
158 158
                                     case 'seeders':
159
-                                        $bootstrap[$key][] = $class;
159
+                                        $bootstrap[ $key ][ ] = $class;
160 160
                                         break;
161 161
                                     case 'models':
162
-                                        $bootstrap[$key][] = $class;
162
+                                        $bootstrap[ $key ][ ] = $class;
163 163
                                         break;
164 164
                                     case 'policies':
165
-                                        $bootstrap[$key][] = $this->buildPolicyArray($class, $namespace);
165
+                                        $bootstrap[ $key ][ ] = $this->buildPolicyArray($class, $namespace);
166 166
                                         break;
167 167
                                     case 'providers':
168
-                                        $bootstrap[$key][] = $class;
168
+                                        $bootstrap[ $key ][ ] = $class;
169 169
                                         break;
170 170
                                     case 'events':
171
-                                        $bootstrap[$key][] = $this->buildEventsArray($class);
171
+                                        $bootstrap[ $key ][ ] = $this->buildEventsArray($class);
172 172
                                         break;
173 173
                                     default:
174 174
                                         break;
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
      */
191 191
     private function hasPhpExtension(string $fileName): bool
192 192
     {
193
-        return strlen($fileName) > 4 && '.php' === ($fileName[-4] . $fileName[-3] . $fileName[-2] . $fileName[-1]);
193
+        return strlen($fileName) > 4 && '.php' === ($fileName[-4 ].$fileName[-3 ].$fileName[-2 ].$fileName[-1 ]);
194 194
     }
195 195
 
196 196
     /**
@@ -221,9 +221,9 @@  discard block
 block discarded – undo
221 221
         $apiDomain = str_replace('http://', '', $apiDomain);
222 222
         $apiDomain = str_replace('https://', '', $apiDomain);
223 223
         $moduleNamespace = $namespace;
224
-        $moduleName = explode('\\', $moduleNamespace)[1];
225
-        $controllerNamespace = $moduleNamespace . '\\' . 'Http\\Controllers';
226
-        $modelNameSpace = $moduleNamespace . '\\' . 'Entities\\' . $moduleName;
224
+        $moduleName = explode('\\', $moduleNamespace)[ 1 ];
225
+        $controllerNamespace = $moduleNamespace.'\\'.'Http\\Controllers';
226
+        $modelNameSpace = $moduleNamespace.'\\'.'Entities\\'.$moduleName;
227 227
 
228 228
         return [
229 229
             'path' => $path,
@@ -244,8 +244,8 @@  discard block
 block discarded – undo
244 244
     private function buildPolicyArray($class, $namespace)
245 245
     {
246 246
         $moduleNamespace = $namespace;
247
-        $moduleName = explode('\\', $moduleNamespace)[1];
248
-        $modelNameSpace = $moduleNamespace . '\\' . 'Entities\\' . $moduleName;
247
+        $moduleName = explode('\\', $moduleNamespace)[ 1 ];
248
+        $modelNameSpace = $moduleNamespace.'\\'.'Entities\\'.$moduleName;
249 249
 
250 250
         return [
251 251
             'class' => $class,
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
             $listeners = array();
289 289
             foreach ($listenerProperties as $listener) {
290 290
                 if (class_implements_interface($listener, ListenerContract::class)) {
291
-                    $listeners[] = $listener;
291
+                    $listeners[ ] = $listener;
292 292
                 }
293 293
             }
294 294
         } catch (\ReflectionException $e) {
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
      */
306 306
     public function getCommands(): array
307 307
     {
308
-        return $this->loadBootstrapFromCache()['commands'] ?? [];
308
+        return $this->loadBootstrapFromCache()[ 'commands' ] ?? [ ];
309 309
     }
310 310
 
311 311
     /**
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
      */
314 314
     public function getRoutes(): array
315 315
     {
316
-        return $this->loadBootstrapFromCache()['routes'] ?? [];
316
+        return $this->loadBootstrapFromCache()[ 'routes' ] ?? [ ];
317 317
     }
318 318
 
319 319
     /**
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
      */
322 322
     public function getConfigs(): array
323 323
     {
324
-        return $this->loadBootstrapFromCache()['configs'] ?? [];
324
+        return $this->loadBootstrapFromCache()[ 'configs' ] ?? [ ];
325 325
     }
326 326
 
327 327
     /**
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
      */
330 330
     public function getFactories(): array
331 331
     {
332
-        return $this->loadBootstrapFromCache()['factories'] ?? [];
332
+        return $this->loadBootstrapFromCache()[ 'factories' ] ?? [ ];
333 333
     }
334 334
 
335 335
     /**
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
      */
338 338
     public function getMigrations(): array
339 339
     {
340
-        return $this->loadBootstrapFromCache()['migrations'] ?? [];
340
+        return $this->loadBootstrapFromCache()[ 'migrations' ] ?? [ ];
341 341
     }
342 342
 
343 343
     /**
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
      */
346 346
     public function getSeeders(): array
347 347
     {
348
-        return $this->loadBootstrapFromCache()['seeders'] ?? [];
348
+        return $this->loadBootstrapFromCache()[ 'seeders' ] ?? [ ];
349 349
     }
350 350
 
351 351
     /**
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
      */
354 354
     public function getModels(): array
355 355
     {
356
-        return $this->loadBootstrapFromCache()['models'] ?? [];
356
+        return $this->loadBootstrapFromCache()[ 'models' ] ?? [ ];
357 357
     }
358 358
 
359 359
     /**
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
      */
362 362
     public function getPolicies(): array
363 363
     {
364
-        return $this->loadBootstrapFromCache()['policies'] ?? [];
364
+        return $this->loadBootstrapFromCache()[ 'policies' ] ?? [ ];
365 365
     }
366 366
 
367 367
     /**
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
      */
370 370
     public function getProviders(): array
371 371
     {
372
-        return $this->loadBootstrapFromCache()['providers'] ?? [];
372
+        return $this->loadBootstrapFromCache()[ 'providers' ] ?? [ ];
373 373
     }
374 374
 
375 375
     /**
@@ -377,6 +377,6 @@  discard block
 block discarded – undo
377 377
      */
378 378
     public function getEvents(): array
379 379
     {
380
-        return $this->loadBootstrapFromCache()['events'] ?? [];
380
+        return $this->loadBootstrapFromCache()[ 'events' ] ?? [ ];
381 381
     }
382 382
 }
Please login to merge, or discard this patch.
src/Foundation/Resources/NotificationResource.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
      */
23 23
     public function toArray($request)
24 24
     {
25
-        $notification = (object)$this->data;
25
+        $notification = (object) $this->data;
26 26
         $resource = [
27 27
             'id' => $this->getKey(),
28 28
             'title' => $notification->title,
Please login to merge, or discard this patch.
src/Foundation/Providers/BootstrapServiceProvider.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -70,16 +70,16 @@  discard block
 block discarded – undo
70 70
     private function loadRoutes()
71 71
     {
72 72
         foreach ($this->bootstrapService->getRoutes() as $route) {
73
-            $path = $route['path'];
73
+            $path = $route[ 'path' ];
74 74
             Route::group([
75
-                'prefix' => 'v1/' . $route['module'],
76
-                'namespace' => $route['controller'],
77
-                'domain' => $route['domain'],
78
-                'middleware' => ['api'],
79
-            ], function () use ($path) {
75
+                'prefix' => 'v1/'.$route[ 'module' ],
76
+                'namespace' => $route[ 'controller' ],
77
+                'domain' => $route[ 'domain' ],
78
+                'middleware' => [ 'api' ],
79
+            ], function() use ($path) {
80 80
                 require $path;
81 81
             });
82
-            Route::model($route['module'], $route['model']);
82
+            Route::model($route[ 'module' ], $route[ 'model' ]);
83 83
         }
84 84
     }
85 85
 
@@ -91,12 +91,12 @@  discard block
 block discarded – undo
91 91
     protected function loadConfigs()
92 92
     {
93 93
         foreach ($this->bootstrapService->getConfigs() as $config) {
94
-            if ($config['filename'] === 'config.php') {
94
+            if ($config[ 'filename' ] === 'config.php') {
95 95
                 $this->publishes([
96
-                    $config['path'] => config_path($config['module']),
96
+                    $config[ 'path' ] => config_path($config[ 'module' ]),
97 97
                 ], 'config');
98 98
                 $this->mergeConfigFrom(
99
-                    $config['path'], basename($config['module'], '.php')
99
+                    $config[ 'path' ], basename($config[ 'module' ], '.php')
100 100
                 );
101 101
             }
102 102
         }
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
     {
112 112
         foreach ($this->bootstrapService->getFactories() as $factory) {
113 113
             if (!$this->app->environment('production')) {
114
-                app(Factory::class)->load($factory['path']);
114
+                app(Factory::class)->load($factory[ 'path' ]);
115 115
             }
116 116
         }
117 117
     }
@@ -124,15 +124,15 @@  discard block
 block discarded – undo
124 124
     public function loadMigrations()
125 125
     {
126 126
         foreach ($this->bootstrapService->getMigrations() as $migration) {
127
-            $this->loadMigrationsFrom($migration['path']);
127
+            $this->loadMigrationsFrom($migration[ 'path' ]);
128 128
         }
129 129
     }
130 130
 
131 131
     private function loadPolicies()
132 132
     {
133 133
         foreach ($this->bootstrapService->getPolicies() as $policy) {
134
-            if (class_implements_interface($policy['class'], ModelPolicyContract::class)) {
135
-                Gate::policy($policy['model'], $policy['class']);
134
+            if (class_implements_interface($policy[ 'class' ], ModelPolicyContract::class)) {
135
+                Gate::policy($policy[ 'model' ], $policy[ 'class' ]);
136 136
             }
137 137
         }
138 138
     }
@@ -141,14 +141,14 @@  discard block
 block discarded – undo
141 141
     {
142 142
         $app = $this->app;
143 143
         $service = $this->bootstrapService;
144
-        $this->app->extend('command.seed', function () use ($app, $service) {
145
-            return new SeedCommand($app['db'], $service);
144
+        $this->app->extend('command.seed', function() use ($app, $service) {
145
+            return new SeedCommand($app[ 'db' ], $service);
146 146
         });
147 147
     }
148 148
 
149 149
     private function loadCacheObservers()
150 150
     {
151
-        if ((bool)config('model.caching')) {
151
+        if ((bool) config('model.caching')) {
152 152
             foreach ($this->bootstrapService->getModels() as $model) {
153 153
                 if (class_uses_trait($model, Cacheable::class)) {
154 154
                     $model::observe(CacheObserver::class);
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
         foreach ($this->bootstrapService->getModels() as $model) {
163 163
             if (class_implements_interface($model, Ownable::class)) {
164 164
                 Gate::policy($model, OwnershipPolicy::class);
165
-                Gate::define('access', OwnershipPolicy::class . '@access');
165
+                Gate::define('access', OwnershipPolicy::class.'@access');
166 166
             }
167 167
         }
168 168
     }
@@ -177,8 +177,8 @@  discard block
 block discarded – undo
177 177
     private function loadListeners()
178 178
     {
179 179
         foreach ($this->bootstrapService->getEvents() as $event) {
180
-            foreach ($event['listeners'] as $listener) {
181
-                Event::listen($event['class'], $listener);
180
+            foreach ($event[ 'listeners' ] as $listener) {
181
+                Event::listen($event[ 'class' ], $listener);
182 182
             }
183 183
         }
184 184
     }
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/Models/MongoDatabaseNotification.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
      *
32 32
      * @var array
33 33
      */
34
-    protected $guarded = [];
34
+    protected $guarded = [ ];
35 35
     /**
36 36
      * The attributes that should be cast to native types.
37 37
      *
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
     public function markAsRead()
57 57
     {
58 58
         if (is_null($this->read_at)) {
59
-            $this->forceFill(['read_at' => $this->freshTimestamp()])->save();
59
+            $this->forceFill([ 'read_at' => $this->freshTimestamp() ])->save();
60 60
         }
61 61
     }
62 62
     /**
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
      * @param  array  $models
84 84
      * @return \Illuminate\Notifications\DatabaseNotificationCollection
85 85
      */
86
-    public function newCollection(array $models = [])
86
+    public function newCollection(array $models = [ ])
87 87
     {
88 88
         return new DatabaseNotificationCollection($models);
89 89
     }
Please login to merge, or discard this patch.
src/Foundation/Events/WebNotificationCreatedEvent.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 
14 14
 class WebNotificationCreatedEvent extends BroadcastNotificationCreated
15 15
 {
16
-    public function broadcastAs(){
16
+    public function broadcastAs() {
17 17
         return 'notification.created';
18 18
     }
19 19
 }
Please login to merge, or discard this patch.