@@ -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 ]); |
|
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | public function up() |
| 14 | 14 | { |
| 15 | - Schema::create('users', function (Blueprint $table) { |
|
| 15 | + Schema::create('users', function(Blueprint $table) { |
|
| 16 | 16 | $table->increments('id'); |
| 17 | 17 | $table->string('identity_id')->unique(); |
| 18 | 18 | $table->string('email'); |
@@ -22,13 +22,15 @@ |
||
| 22 | 22 | |
| 23 | 23 | public function find($id): ?User |
| 24 | 24 | { |
| 25 | - if ($id instanceof User) |
|
| 26 | - return $id; |
|
| 25 | + if ($id instanceof User) { |
|
| 26 | + return $id; |
|
| 27 | + } |
|
| 27 | 28 | |
| 28 | 29 | $user = User::find($id); |
| 29 | 30 | |
| 30 | - if ($user === null) |
|
| 31 | - throw new NotFoundHttpException(); |
|
| 31 | + if ($user === null) { |
|
| 32 | + throw new NotFoundHttpException(); |
|
| 33 | + } |
|
| 32 | 34 | |
| 33 | 35 | return $user; |
| 34 | 36 | } |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | public function getUserByUserInfo($userInfo) |
| 49 | 49 | { |
| 50 | - return $this->upsertUser($userInfo['profile']); |
|
| 50 | + return $this->upsertUser($userInfo[ 'profile' ]); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | protected function upsertUser($profile) |
@@ -56,8 +56,8 @@ discard block |
||
| 56 | 56 | throw new BadRequestHttpException('Missing token information: Auth0 user id is not set'); |
| 57 | 57 | } |
| 58 | 58 | $identifier = explode('|', $profile->user_id); |
| 59 | - $identityProvider = $identifier[0]; |
|
| 60 | - $id = $identifier[1]; |
|
| 59 | + $identityProvider = $identifier[ 0 ]; |
|
| 60 | + $id = $identifier[ 1 ]; |
|
| 61 | 61 | |
| 62 | 62 | $user = $this->service->findByIdentityId($id); |
| 63 | 63 | if ($user === null) { |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | |
| 94 | 94 | public function getTestUserToken(): \stdClass |
| 95 | 95 | { |
| 96 | - return Cache::remember('testing:http_access_token', 60, function () { |
|
| 96 | + return Cache::remember('testing:http_access_token', 60, function() { |
|
| 97 | 97 | try { |
| 98 | 98 | $httpClient = new Client(); |
| 99 | 99 | $response = $httpClient->post(env('AUTH0_DOMAIN').'oauth/token', [ |
@@ -38,23 +38,23 @@ discard block |
||
| 38 | 38 | */ |
| 39 | 39 | public function handle() |
| 40 | 40 | { |
| 41 | - Model::unguarded(function () { |
|
| 41 | + Model::unguarded(function() { |
|
| 42 | 42 | $seeders = $this->getSeeders(); |
| 43 | 43 | |
| 44 | - $priorities = []; |
|
| 45 | - $prioritySeeders = []; |
|
| 46 | - $nonPrioritySeeders = []; |
|
| 44 | + $priorities = [ ]; |
|
| 45 | + $prioritySeeders = [ ]; |
|
| 46 | + $nonPrioritySeeders = [ ]; |
|
| 47 | 47 | foreach ($seeders as $seeder) { |
| 48 | 48 | $priority = get_class_property($seeder, 'priority'); |
| 49 | 49 | if (!is_int($priority) && $priority !== null) { |
| 50 | 50 | throw new Exception('Priority on seeder must be integer'); |
| 51 | 51 | } elseif ($priority !== null && in_array($priority, $priorities)) { |
| 52 | - throw new Exception("Duplicate priority on seeder $seeder with $prioritySeeders[$priority]"); |
|
| 52 | + throw new Exception("Duplicate priority on seeder $seeder with $prioritySeeders[ $priority ]"); |
|
| 53 | 53 | } elseif ($priority === null) { |
| 54 | - $nonPrioritySeeders[] = $seeder; |
|
| 54 | + $nonPrioritySeeders[ ] = $seeder; |
|
| 55 | 55 | } else { |
| 56 | - $priorities[] = $priority; |
|
| 57 | - $prioritySeeders[$priority] = $seeder; |
|
| 56 | + $priorities[ ] = $priority; |
|
| 57 | + $prioritySeeders[ $priority ] = $seeder; |
|
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | ksort($prioritySeeders); |
@@ -75,6 +75,6 @@ discard block |
||
| 75 | 75 | { |
| 76 | 76 | $this->service = $this->laravel->make(BootstrapRegistrarService::class); |
| 77 | 77 | |
| 78 | - return $this->service->getSeeders() ?? []; |
|
| 78 | + return $this->service->getSeeders() ?? [ ]; |
|
| 79 | 79 | } |
| 80 | 80 | } |
@@ -63,8 +63,9 @@ |
||
| 63 | 63 | foreach ($seeders as $seeder) { |
| 64 | 64 | $seeder = $this->laravel->make($seeder); |
| 65 | 65 | $seeder->__invoke(); |
| 66 | - if (class_implements_interface($seeder, DemoSeederContract::class)) |
|
| 67 | - $seeder->runDemo(); |
|
| 66 | + if (class_implements_interface($seeder, DemoSeederContract::class)) { |
|
| 67 | + $seeder->runDemo(); |
|
| 68 | + } |
|
| 68 | 69 | } |
| 69 | 70 | }); |
| 70 | 71 | |