@@ -74,16 +74,16 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -111,7 +111,7 @@ |
||
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 | } |
@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | use Faker\Generator as Faker; |
4 | 4 | |
5 | -$factory->define(Modules\Machine\Entities\Machine::class, function (Faker $faker) { |
|
5 | +$factory->define(Modules\Machine\Entities\Machine::class, function(Faker $faker) { |
|
6 | 6 | $os = [ |
7 | 7 | 'MAC', |
8 | 8 | 'WINDOWS', |
@@ -99,6 +99,6 @@ |
||
99 | 99 | |
100 | 100 | $this->authorize('delete', $machine); |
101 | 101 | |
102 | - return \response()->json(['deleted']); |
|
102 | + return \response()->json([ 'deleted' ]); |
|
103 | 103 | } |
104 | 104 | } |
@@ -31,7 +31,7 @@ |
||
31 | 31 | /** |
32 | 32 | * @var array |
33 | 33 | */ |
34 | - protected $guarded = []; |
|
34 | + protected $guarded = [ ]; |
|
35 | 35 | |
36 | 36 | public function user() |
37 | 37 | { |
@@ -13,9 +13,9 @@ |
||
13 | 13 | |
14 | 14 | use Modules\Authorization\Entities\Permission; |
15 | 15 | |
16 | -Route::get('/{id}', 'MachineController@show')->middleware(['permission:'.Permission::SHOW_MACHINE]); |
|
17 | -Route::patch('/{id}', 'MachineController@update')->middleware(['permission:'.Permission::UPDATE_MACHINE]); |
|
18 | -Route::delete('/{id}', 'MachineController@destroy')->middleware(['permission:'.Permission::DELETE_MACHINE]); |
|
16 | +Route::get('/{id}', 'MachineController@show')->middleware([ 'permission:'.Permission::SHOW_MACHINE ]); |
|
17 | +Route::patch('/{id}', 'MachineController@update')->middleware([ 'permission:'.Permission::UPDATE_MACHINE ]); |
|
18 | +Route::delete('/{id}', 'MachineController@destroy')->middleware([ 'permission:'.Permission::DELETE_MACHINE ]); |
|
19 | 19 | |
20 | -Route::post('/', 'MachineController@store')->middleware(['permission:'.Permission::CREATE_MACHINE]); |
|
21 | -Route::get('/', 'MachineController@index')->middleware(['permission:'.Permission::SHOW_MACHINE]); |
|
20 | +Route::post('/', 'MachineController@store')->middleware([ 'permission:'.Permission::CREATE_MACHINE ]); |
|
21 | +Route::get('/', 'MachineController@index')->middleware([ 'permission:'.Permission::SHOW_MACHINE ]); |
@@ -14,5 +14,5 @@ |
||
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 ]); |
@@ -2,14 +2,14 @@ |
||
2 | 2 | |
3 | 3 | use Modules\User\Entities\User; |
4 | 4 | |
5 | -$factory->define(User::class, function (Faker\Generator $faker) { |
|
5 | +$factory->define(User::class, function(Faker\Generator $faker) { |
|
6 | 6 | return [ |
7 | 7 | 'identity_id' => (new \MongoDB\BSON\ObjectId())->__toString(), |
8 | 8 | 'name' => $faker->name, |
9 | 9 | 'username' => $faker->userName, |
10 | 10 | 'email' => $faker->unique()->safeEmail, |
11 | 11 | 'email_verified' => $faker->boolean, |
12 | - 'gender' => get_random_array_element(['male', 'female', 'unknown']), |
|
12 | + 'gender' => get_random_array_element([ 'male', 'female', 'unknown' ]), |
|
13 | 13 | 'avatar' => 'https://i1.wp.com/cdn.auth0.com/avatars/ad.png', |
14 | 14 | 'provider' => 'database', |
15 | 15 | ]; |
@@ -35,23 +35,23 @@ discard block |
||
35 | 35 | |
36 | 36 | $this->resolver->setDefaultConnection($this->getDatabase()); |
37 | 37 | |
38 | - Model::unguarded(function () { |
|
38 | + Model::unguarded(function() { |
|
39 | 39 | $seeders = $this->getSeeders(); |
40 | 40 | |
41 | - $priorities = []; |
|
42 | - $prioritySeeders = []; |
|
43 | - $nonPrioritySeeders = []; |
|
41 | + $priorities = [ ]; |
|
42 | + $prioritySeeders = [ ]; |
|
43 | + $nonPrioritySeeders = [ ]; |
|
44 | 44 | foreach ($seeders as $seeder) { |
45 | 45 | $priority = get_class_property($seeder, 'priority'); |
46 | 46 | if (!is_int($priority) && $priority !== null) { |
47 | 47 | throw new Exception('Priority on seeder must be integer'); |
48 | 48 | } elseif ($priority !== null && in_array($priority, $priorities)) { |
49 | - throw new Exception("Duplicate priority on seeder $seeder with $prioritySeeders[$priority]"); |
|
49 | + throw new Exception("Duplicate priority on seeder $seeder with $prioritySeeders[ $priority ]"); |
|
50 | 50 | } elseif ($priority === null) { |
51 | - $nonPrioritySeeders[] = $seeder; |
|
51 | + $nonPrioritySeeders[ ] = $seeder; |
|
52 | 52 | } else { |
53 | - $priorities[] = $priority; |
|
54 | - $prioritySeeders[$priority] = $seeder; |
|
53 | + $priorities[ ] = $priority; |
|
54 | + $prioritySeeders[ $priority ] = $seeder; |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 | ksort($prioritySeeders); |
@@ -74,6 +74,6 @@ discard block |
||
74 | 74 | { |
75 | 75 | $this->service = $this->laravel->make(BootstrapRegistrarService::class); |
76 | 76 | |
77 | - return $this->service->getSeeders() ?? []; |
|
77 | + return $this->service->getSeeders() ?? [ ]; |
|
78 | 78 | } |
79 | 79 | } |
@@ -59,8 +59,9 @@ |
||
59 | 59 | |
60 | 60 | foreach ($seeders as $seeder) { |
61 | 61 | $seeder = $this->laravel->make($seeder); |
62 | - if (!isset($seeder->seed) || $seeder->seed === false) |
|
63 | - $seeder->__invoke(); |
|
62 | + if (!isset($seeder->seed) || $seeder->seed === false) { |
|
63 | + $seeder->__invoke(); |
|
64 | + } |
|
64 | 65 | } |
65 | 66 | }); |
66 | 67 |