Passed
Push — master ( 96222b...f19e46 )
by Arthur
23:27
created
src/Modules/User/Routes/users.v1.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,5 +14,5 @@
 block discarded – undo
14 14
 use Modules\Authorization\Entities\Permission;
15 15
 
16 16
 Route::get('/me', 'UserController@show');
17
-Route::patch('/{id}', 'UserController@update')->middleware(['permission:'.Permission::ASSIGN_ROLES]);
18
-Route::get('/', 'UserController@index')->middleware(['permission:'.Permission::INDEX_USERS]);
17
+Route::patch('/{id}', 'UserController@update')->middleware([ 'permission:'.Permission::ASSIGN_ROLES ]);
18
+Route::get('/', 'UserController@index')->middleware([ 'permission:'.Permission::INDEX_USERS ]);
Please login to merge, or discard this patch.
src/Modules/Demo/Jobs/AlterDemoDataJob.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
                 'cpu_usage'    => rand(0, 100),
54 54
                 'memory_usage' => rand(1, $machine->memory_available),
55 55
             ]);
56
-            $this->machineService->update($machine, ['online' => (bool) rand(0, 1)]);
56
+            $this->machineService->update($machine, [ 'online' => (bool) rand(0, 1) ]);
57 57
         }
58 58
     }
59 59
 
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
                 'cpu_usage'    => rand(0, 100),
65 65
                 'memory_usage' => rand(1, $account->memory_available),
66 66
             ]);
67
-            $this->accountService->update($account, ['online' => (bool) rand(0, 1)]);
67
+            $this->accountService->update($account, [ 'online' => (bool) rand(0, 1) ]);
68 68
         }
69 69
     }
70 70
 }
Please login to merge, or discard this patch.
src/Foundation/Services/BootstrapRegistrarService.php 1 patch
Spacing   +31 added lines, -31 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
     /**
@@ -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/Providers/BootstrapServiceProvider.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -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
         }
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
     {
128 128
         foreach ($this->bootstrapService->getFactories() as $factory) {
129 129
             if (!$this->app->environment('production')) {
130
-                app(Factory::class)->load($factory['path']);
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,8 +193,8 @@  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
     }
Please login to merge, or discard this patch.
src/Modules/Account/Events/AccountUpdatedEvent.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
 
17 17
 class AccountUpdatedEvent extends Event implements ShouldBroadcast
18 18
 {
19
-    public $listeners = [];
19
+    public $listeners = [ ];
20 20
 
21 21
     /**
22 22
      * @var account
Please login to merge, or discard this patch.
src/Modules/Account/Entities/Account.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
     /**
34 34
      * @var array
35 35
      */
36
-    protected $guarded = [];
36
+    protected $guarded = [ ];
37 37
 
38 38
     protected $casts = [
39 39
         'online' => 'boolean',
Please login to merge, or discard this patch.
src/Modules/Account/Services/AccountService.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
 
64 64
     public function assignToMachine($id, ?Machine $machine)
65 65
     {
66
-        return $this->update($id, ['machine_id' => $machine->id ?? null]);
66
+        return $this->update($id, [ 'machine_id' => $machine->id ?? null ]);
67 67
     }
68 68
 
69 69
     public function unlinkFromMachine($id)
Please login to merge, or discard this patch.
src/Modules/Account/Database/factories/AccountFactory.php 2 patches
Indentation   +84 added lines, -84 removed lines patch added patch discarded remove patch
@@ -5,90 +5,90 @@
 block discarded – undo
5 5
 
6 6
 $factory->define(Account::class, function (Faker $faker) {
7 7
     return [
8
-         'user_id'           => 1,
9
-         'username'          => $faker->unique()->safeEmail,
10
-         'password'          => $faker->password,
11
-         'game'              => 'OSRS',
12
-         'banned_at'         => $faker->boolean(80) ? null : \Carbon\Carbon::now()->subHours($faker->numberBetween(1, 500)),
13
-         'last_heartbeat_at' => $faker->boolean(50) ? null : \Carbon\Carbon::now()->subSeconds($faker->numberBetween(1, 500)),
14
-         'performance_mode'  => array_random([
15
-             'EXTREME',
16
-             'MEDIUM',
17
-             'DISABLED',
18
-         ]),
19
-         'logged_in'  => $faker->boolean,
20
-         'machine_id' => 1,
21
-     ];
8
+            'user_id'           => 1,
9
+            'username'          => $faker->unique()->safeEmail,
10
+            'password'          => $faker->password,
11
+            'game'              => 'OSRS',
12
+            'banned_at'         => $faker->boolean(80) ? null : \Carbon\Carbon::now()->subHours($faker->numberBetween(1, 500)),
13
+            'last_heartbeat_at' => $faker->boolean(50) ? null : \Carbon\Carbon::now()->subSeconds($faker->numberBetween(1, 500)),
14
+            'performance_mode'  => array_random([
15
+                'EXTREME',
16
+                'MEDIUM',
17
+                'DISABLED',
18
+            ]),
19
+            'logged_in'  => $faker->boolean,
20
+            'machine_id' => 1,
21
+        ];
22 22
 });
23 23
 
24
- $factory->state(Account::class, 'OSRS', function (Faker $faker) {
25
-     return [
26
-         'game'                  => 'OSRS',
27
-         'bank_pin'              => $faker->randomNumber(4, true),
28
-         'ingame_name'           => $faker->userName,
29
-         'membership_expires_at' => $faker->boolean(80) ? null : \Carbon\Carbon::now()->addHours($faker->numberBetween(1, 500)),
30
-         'location'              => [
31
-             'x' => $faker->numberBetween(-10000, 10000),
32
-             'y' => $faker->numberBetween(-10000, 10000),
33
-             'z' => $faker->numberBetween(0, 3),
34
-         ],
35
-         'skills' => [
36
-             'hitpoints'    => $faker->numberBetween(0, 200000000),
37
-             'attack'       => $faker->numberBetween(0, 200000000),
38
-             'strength'     => $faker->numberBetween(0, 200000000),
39
-             'defence'      => $faker->numberBetween(0, 200000000),
40
-             'ranged'       => $faker->numberBetween(0, 200000000),
41
-             'prayer'       => $faker->numberBetween(0, 200000000),
42
-             'magic'        => $faker->numberBetween(0, 200000000),
43
-             'runecrafting' => $faker->numberBetween(0, 200000000),
44
-             'crafting'     => $faker->numberBetween(0, 200000000),
45
-             'mining'       => $faker->numberBetween(0, 200000000),
46
-             'smithing'     => $faker->numberBetween(0, 200000000),
47
-             'fishing'      => $faker->numberBetween(0, 200000000),
48
-             'cooking'      => $faker->numberBetween(0, 200000000),
49
-             'firemaking'   => $faker->numberBetween(0, 200000000),
50
-             'woodcutting'  => $faker->numberBetween(0, 200000000),
51
-             'agility'      => $faker->numberBetween(0, 200000000),
52
-             'herblore'     => $faker->numberBetween(0, 200000000),
53
-             'thieving'     => $faker->numberBetween(0, 200000000),
54
-             'fletching'    => $faker->numberBetween(0, 200000000),
55
-             'slayer'       => $faker->numberBetween(0, 200000000),
56
-             'farming'      => $faker->numberBetween(0, 200000000),
57
-             'construction' => $faker->numberBetween(0, 200000000),
58
-             'hunter'       => $faker->numberBetween(0, 200000000),
59
-         ],
60
-         'items' => [
61
-             'bank' => [
62
-                 [
63
-                     'item_id' => 5,
64
-                     'amount'  => 2,
65
-                 ],
66
-                 [
67
-                     'item_id' => 4,
68
-                     'amount'  => 3,
69
-                 ],
70
-                 [
71
-                     'item_id' => 2,
72
-                     'amount'  => 1,
73
-                 ],
74
-             ],
75
-             'equipment'      => [],
76
-             'grand_exchange' => [
77
-                 [
78
-                     'item_id' => 5,
79
-                     'amount'  => 2,
80
-                 ],
81
-             ],
82
-             'inventory' => [],
83
-         ],
84
-     ];
85
- });
24
+    $factory->state(Account::class, 'OSRS', function (Faker $faker) {
25
+        return [
26
+            'game'                  => 'OSRS',
27
+            'bank_pin'              => $faker->randomNumber(4, true),
28
+            'ingame_name'           => $faker->userName,
29
+            'membership_expires_at' => $faker->boolean(80) ? null : \Carbon\Carbon::now()->addHours($faker->numberBetween(1, 500)),
30
+            'location'              => [
31
+                'x' => $faker->numberBetween(-10000, 10000),
32
+                'y' => $faker->numberBetween(-10000, 10000),
33
+                'z' => $faker->numberBetween(0, 3),
34
+            ],
35
+            'skills' => [
36
+                'hitpoints'    => $faker->numberBetween(0, 200000000),
37
+                'attack'       => $faker->numberBetween(0, 200000000),
38
+                'strength'     => $faker->numberBetween(0, 200000000),
39
+                'defence'      => $faker->numberBetween(0, 200000000),
40
+                'ranged'       => $faker->numberBetween(0, 200000000),
41
+                'prayer'       => $faker->numberBetween(0, 200000000),
42
+                'magic'        => $faker->numberBetween(0, 200000000),
43
+                'runecrafting' => $faker->numberBetween(0, 200000000),
44
+                'crafting'     => $faker->numberBetween(0, 200000000),
45
+                'mining'       => $faker->numberBetween(0, 200000000),
46
+                'smithing'     => $faker->numberBetween(0, 200000000),
47
+                'fishing'      => $faker->numberBetween(0, 200000000),
48
+                'cooking'      => $faker->numberBetween(0, 200000000),
49
+                'firemaking'   => $faker->numberBetween(0, 200000000),
50
+                'woodcutting'  => $faker->numberBetween(0, 200000000),
51
+                'agility'      => $faker->numberBetween(0, 200000000),
52
+                'herblore'     => $faker->numberBetween(0, 200000000),
53
+                'thieving'     => $faker->numberBetween(0, 200000000),
54
+                'fletching'    => $faker->numberBetween(0, 200000000),
55
+                'slayer'       => $faker->numberBetween(0, 200000000),
56
+                'farming'      => $faker->numberBetween(0, 200000000),
57
+                'construction' => $faker->numberBetween(0, 200000000),
58
+                'hunter'       => $faker->numberBetween(0, 200000000),
59
+            ],
60
+            'items' => [
61
+                'bank' => [
62
+                    [
63
+                        'item_id' => 5,
64
+                        'amount'  => 2,
65
+                    ],
66
+                    [
67
+                        'item_id' => 4,
68
+                        'amount'  => 3,
69
+                    ],
70
+                    [
71
+                        'item_id' => 2,
72
+                        'amount'  => 1,
73
+                    ],
74
+                ],
75
+                'equipment'      => [],
76
+                'grand_exchange' => [
77
+                    [
78
+                        'item_id' => 5,
79
+                        'amount'  => 2,
80
+                    ],
81
+                ],
82
+                'inventory' => [],
83
+            ],
84
+        ];
85
+    });
86 86
 
87
- $factory->state(Account::class, 'RS3', function (Faker $faker) {
88
-     return [
89
-         'game'                  => 'RS3',
90
-         'bank_pin'              => $faker->randomNumber(4, true),
91
-         'ingame_name'           => $faker->userName,
92
-         'membership_expires_at' => null,
93
-     ];
94
- });
87
+    $factory->state(Account::class, 'RS3', function (Faker $faker) {
88
+        return [
89
+            'game'                  => 'RS3',
90
+            'bank_pin'              => $faker->randomNumber(4, true),
91
+            'ingame_name'           => $faker->userName,
92
+            'membership_expires_at' => null,
93
+        ];
94
+    });
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 use Faker\Generator as Faker;
4 4
 use Modules\Account\Entities\Account;
5 5
 
6
-$factory->define(Account::class, function (Faker $faker) {
6
+$factory->define(Account::class, function(Faker $faker) {
7 7
     return [
8 8
          'user_id'           => 1,
9 9
          'username'          => $faker->unique()->safeEmail,
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
      ];
22 22
 });
23 23
 
24
- $factory->state(Account::class, 'OSRS', function (Faker $faker) {
24
+ $factory->state(Account::class, 'OSRS', function(Faker $faker) {
25 25
      return [
26 26
          'game'                  => 'OSRS',
27 27
          'bank_pin'              => $faker->randomNumber(4, true),
@@ -72,19 +72,19 @@  discard block
 block discarded – undo
72 72
                      'amount'  => 1,
73 73
                  ],
74 74
              ],
75
-             'equipment'      => [],
75
+             'equipment'      => [ ],
76 76
              'grand_exchange' => [
77 77
                  [
78 78
                      'item_id' => 5,
79 79
                      'amount'  => 2,
80 80
                  ],
81 81
              ],
82
-             'inventory' => [],
82
+             'inventory' => [ ],
83 83
          ],
84 84
      ];
85 85
  });
86 86
 
87
- $factory->state(Account::class, 'RS3', function (Faker $faker) {
87
+ $factory->state(Account::class, 'RS3', function(Faker $faker) {
88 88
      return [
89 89
          'game'                  => 'RS3',
90 90
          'bank_pin'              => $faker->randomNumber(4, true),
Please login to merge, or discard this patch.
src/Foundation/Abstracts/Transformers/IncludesRelations.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
             return explode(',', $request->include);
27 27
         }
28 28
 
29
-        return [];
29
+        return [ ];
30 30
     }
31 31
 
32 32
     /**
@@ -35,10 +35,10 @@  discard block
 block discarded – undo
35 35
     public function compileRelations()
36 36
     {
37 37
         $requestedRelations = $this->parseRequestIncludeParameter();
38
-        $relations = [];
38
+        $relations = [ ];
39 39
         foreach ($requestedRelations as $requestedRelation) {
40
-            if (isset($this->available[$requestedRelation])) {
41
-                $relations[$requestedRelation] = $this->available[$requestedRelation];
40
+            if (isset($this->available[ $requestedRelation ])) {
41
+                $relations[ $requestedRelation ] = $this->available[ $requestedRelation ];
42 42
             }
43 43
         }
44 44
         $merge = array_merge($this->include, $relations);
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
         if (is_array($relation)) {
57 57
             $this->include = array_merge($this->include, $relation);
58 58
         } else {
59
-            $this->include[] = $relation;
59
+            $this->include[ ] = $relation;
60 60
         }
61 61
 
62 62
         return $this;
@@ -64,18 +64,18 @@  discard block
 block discarded – undo
64 64
 
65 65
     protected function includeRelations()
66 66
     {
67
-        $relations = [];
67
+        $relations = [ ];
68 68
         if ($this->resource instanceof Model) {
69 69
             $relations = $this->compileRelations();
70 70
             foreach ($relations as $relation => $transformer) {
71 71
                 $relationMethodName = 'transform'.ucfirst(strtolower($relation));
72 72
                 if (method_exists($this, $relationMethodName)) {
73
-                    $relations[$relation] = $this->$relationMethodName($this->resource->$relation);
73
+                    $relations[ $relation ] = $this->$relationMethodName($this->resource->$relation);
74 74
                 } else {
75 75
                     if ($this->resource->$relation instanceof Model) {
76
-                        $relations[$relation] = $transformer::resource($this->whenLoaded($relation));
76
+                        $relations[ $relation ] = $transformer::resource($this->whenLoaded($relation));
77 77
                     } elseif ($this->resource->$relation instanceof Collection) {
78
-                        $relations[$relation] = $transformer::collection($this->whenLoaded($relation));
78
+                        $relations[ $relation ] = $transformer::collection($this->whenLoaded($relation));
79 79
                     }
80 80
                 }
81 81
             }
Please login to merge, or discard this patch.