浏览代码

Apply Pint fixes

Bubka 1 年之前
父节点
当前提交
49fddfd331

+ 9 - 11
app/Api/v1/Controllers/UserManagerController.php

@@ -2,8 +2,8 @@
 
 namespace App\Api\v1\Controllers;
 
-use App\Api\v1\Requests\UserManagerStoreRequest;
 use App\Api\v1\Requests\UserManagerPromoteRequest;
+use App\Api\v1\Requests\UserManagerStoreRequest;
 use App\Api\v1\Resources\UserManagerResource;
 use App\Http\Controllers\Controller;
 use App\Models\User;
@@ -36,7 +36,7 @@ class UserManagerController extends Controller
     }
 
     /**
-     * Reset user's password 
+     * Reset user's password
      *
      * @return \Illuminate\Http\JsonResponse
      */
@@ -59,15 +59,14 @@ class UserManagerController extends Controller
 
         if ($response == Password::PASSWORD_RESET) {
             Log::info(sprintf('Temporary password set for User ID #%s', $user->id));
-    
+
             $response = $this->broker()->sendResetLink(
                 ['email' => $credentials['email']]
             );
-        }
-        else {
+        } else {
             return response()->json([
                 'message' => 'bad request',
-                'reason'  => is_string($response) ? __($response) : __('errors.no_pwd_reset_for_this_user_type')
+                'reason'  => is_string($response) ? __($response) : __('errors.no_pwd_reset_for_this_user_type'),
             ], 400);
         }
 
@@ -75,7 +74,7 @@ class UserManagerController extends Controller
                     ? new UserManagerResource($user)
                     : response()->json([
                         'message' => 'bad request',
-                        'reason'  => __($response)
+                        'reason'  => __($response),
                     ], 400);
     }
 
@@ -89,9 +88,9 @@ class UserManagerController extends Controller
         $validated = $request->validated();
 
         $user = User::create([
-            'name'      => $validated['name'],
-            'email'     => $validated['email'],
-            'password'  => Hash::make($validated['password']),
+            'name'     => $validated['name'],
+            'email'    => $validated['email'],
+            'password' => Hash::make($validated['password']),
         ]);
 
         Log::info(sprintf('User ID #%s created by user ID #%s', $user->id, $request->user()->id));
@@ -196,5 +195,4 @@ class UserManagerController extends Controller
     {
         return Password::broker();
     }
-
 }

+ 1 - 1
app/Api/v1/Requests/SettingUpdateRequest.php

@@ -28,7 +28,7 @@ class SettingUpdateRequest extends FormRequest
         $rule = [
             'value' => [
                 'required',
-            ]
+            ],
         ];
 
         if ($this->route()?->parameter('settingName') == 'restrictList') {

+ 6 - 7
app/Api/v1/Resources/UserManagerResource.php

@@ -38,7 +38,7 @@ class UserManagerResource extends UserResource
     {
         $this->resource = $resource;
         $password_reset = null;
-        
+
         // Password reset token
         $resetToken = DB::table(config('auth.passwords.users.table'))->where(
             'email', $this->resource->getEmailForPasswordReset()
@@ -52,7 +52,7 @@ class UserManagerResource extends UserResource
 
         // Personal Access Tokens (PATs)
         $tokenRepository = App::make(TokenRepository::class);
-        $tokens = $tokenRepository->forUser($this->resource->getAuthIdentifier());
+        $tokens          = $tokenRepository->forUser($this->resource->getAuthIdentifier());
 
         $PATs_count = $tokens->load('client')->filter(function ($token) {
             return $token->client->personal_access_client && ! $token->revoked;
@@ -61,10 +61,9 @@ class UserManagerResource extends UserResource
         $this->with = [
             'password_reset'               => $password_reset,
             'valid_personal_access_tokens' => $PATs_count,
-            'webauthn_credentials'         => $this->resource->webAuthnCredentials()->count()
+            'webauthn_credentials'         => $this->resource->webAuthnCredentials()->count(),
         ];
     }
-    
 
     /**
      * Determine if the token has expired.
@@ -75,7 +74,7 @@ class UserManagerResource extends UserResource
     protected function tokenExpired($createdAt)
     {
         // See Illuminate\Auth\Passwords\DatabaseTokenRepository
-        return Carbon::parse($createdAt)->addSeconds(config('auth.passwords.users.expires', 60)*60)->isPast();
+        return Carbon::parse($createdAt)->addSeconds(config('auth.passwords.users.expires', 60) * 60)->isPast();
     }
 
     /**
@@ -90,8 +89,8 @@ class UserManagerResource extends UserResource
             parent::toArray($request),
             [
                 'twofaccounts_count' => is_null($this->twofaccounts_count) ? 0 : $this->twofaccounts_count,
-                'last_seen_at' => Carbon::parse($this->last_seen_at)->locale(App::getLocale())->diffForHumans(),
-                'created_at'   => Carbon::parse($this->created_at)->locale(App::getLocale())->diffForHumans(),
+                'last_seen_at'       => Carbon::parse($this->last_seen_at)->locale(App::getLocale())->diffForHumans(),
+                'created_at'         => Carbon::parse($this->created_at)->locale(App::getLocale())->diffForHumans(),
             ]
         );
     }

+ 12 - 13
app/Console/Commands/Install.php

@@ -137,7 +137,7 @@ class Install extends Command
     }
 
     /**
-     * 
+     * Runs the passport:install command silently
      */
     protected function installPassport() : void
     {
@@ -147,7 +147,7 @@ class Install extends Command
     }
 
     /**
-     * 
+     * Runs the config:cache command silently
      */
     protected function cacheConfig() : void
     {
@@ -157,11 +157,11 @@ class Install extends Command
     }
 
     /**
-     * 
+     * Runs the storage:link command silently
      */
     protected function createStorageLink() : void
     {
-        if (!file_exists(public_path('storage'))) {
+        if (! file_exists(public_path('storage'))) {
             $this->components->task('Creating storage link', function () : void {
                 $this->callSilently('storage:link');
             });
@@ -169,7 +169,7 @@ class Install extends Command
     }
 
     /**
-     * 
+     * Lets the user set the main environment variables
      */
     protected function setMainEnvVars() : void
     {
@@ -177,8 +177,7 @@ class Install extends Command
             $appUrl = trim($this->ask('URL of this 2FAuth instance', config('app.url')), '/');
             if (filter_var($appUrl, FILTER_VALIDATE_URL)) {
                 break;
-            }
-            else {
+            } else {
                 $this->components->error('This is not a valid URL, please retry');
             }
         }
@@ -195,7 +194,7 @@ class Install extends Command
     }
 
     /**
-     * Prompt user for valid database credentials and set them to .env file.
+     * Prompts user for valid database credentials and sets them to .env file.
      */
     protected function setDbEnvVars() : void
     {
@@ -253,7 +252,7 @@ class Install extends Command
     }
 
     /**
-     * 
+     * Runs db migration with --force option
      */
     protected function migrateDatabase() : mixed
     {
@@ -265,7 +264,7 @@ class Install extends Command
     }
 
     /**
-     * 
+     * Clears some caches
      */
     protected function clearCaches() : void
     {
@@ -276,7 +275,7 @@ class Install extends Command
     }
 
     /**
-     * 
+     * Loads the existing env file or creates it
      */
     protected function loadEnvFile() : void
     {
@@ -300,7 +299,7 @@ class Install extends Command
     }
 
     /**
-     * 
+     * Generates an app key if necessary
      */
     protected function maybeGenerateAppKey() : void
     {
@@ -317,7 +316,7 @@ class Install extends Command
     }
 
     /**
-     * Generate a random key for the application.
+     * Generates a random key for the application.
      */
     protected function generateRandomKey() : string
     {

+ 0 - 1
app/Http/Controllers/Auth/UserController.php

@@ -8,7 +8,6 @@ use App\Http\Requests\UserDeleteRequest;
 use App\Http\Requests\UserUpdateRequest;
 use App\Models\User;
 use Illuminate\Support\Facades\Auth;
-use Illuminate\Support\Facades\DB;
 use Illuminate\Support\Facades\Hash;
 use Illuminate\Support\Facades\Log;
 

+ 0 - 2
app/Http/Controllers/SystemController.php

@@ -109,6 +109,4 @@ class SystemController extends Controller
 
         return response()->json(['exit-code' => $exitCode], 200);
     }
-
-    
 }

+ 0 - 1
app/Listeners/LogNotification.php

@@ -3,7 +3,6 @@
 namespace App\Listeners;
 
 use Illuminate\Notifications\Events\NotificationSent;
-use Illuminate\Support\Facades\Auth;
 use Illuminate\Support\Facades\Log;
 
 class LogNotification

+ 1 - 3
app/Models/User.php

@@ -9,7 +9,6 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
 use Illuminate\Foundation\Auth\User as Authenticatable;
 use Illuminate\Notifications\Notifiable;
 use Illuminate\Support\Facades\Hash;
-use Illuminate\Support\Facades\Log;
 use Illuminate\Support\Str;
 use Laragear\WebAuthn\WebAuthnAuthentication;
 use Laravel\Passport\HasApiTokens;
@@ -92,7 +91,7 @@ class User extends Authenticatable implements WebAuthnAuthenticatable
     /**
      * Determine if the user is an administrator.
      *
-     * @return boolean
+     * @return bool
      */
     public function isAdministrator()
     {
@@ -102,7 +101,6 @@ class User extends Authenticatable implements WebAuthnAuthenticatable
     /**
      * Grant administrator permissions to the user.
      *
-     * @param  bool  $promote  
      * @return void
      */
     public function promoteToAdministrator(bool $promote = true)

+ 0 - 1
app/Notifications/TestEmailSettingNotification.php

@@ -9,7 +9,6 @@ use Illuminate\Support\Facades\Lang;
 
 class TestEmailSettingNotification extends Notification
 {
-
     // /**
     //  * The callback that should be used to create the reset password URL.
     //  *

+ 7 - 7
app/Observers/UserObserver.php

@@ -14,7 +14,7 @@ class UserObserver
     /**
      * Handle the User "created" event.
      */
-    public function created(User $user): void
+    public function created(User $user) : void
     {
         //
     }
@@ -22,7 +22,7 @@ class UserObserver
     /**
      * Handle the User "updated" event.
      */
-    public function updated(User $user): void
+    public function updated(User $user) : void
     {
         //
     }
@@ -30,7 +30,7 @@ class UserObserver
     /**
      * Handle the User "deleting" event.
      */
-    public function deleting(User $user): bool
+    public function deleting(User $user) : bool
     {
         Log::info(sprintf('Deletion of User ID #%s requested by User ID #%s', $user->id, Auth::user()->id ?? 'unknown'));
 
@@ -39,7 +39,7 @@ class UserObserver
 
         if ($isLastAdmin) {
             Log::notice(sprintf('Deletion of user ID #%s refused, cannot delete the only administrator', $user->id));
-            
+
             return false;
         }
 
@@ -57,7 +57,7 @@ class UserObserver
     /**
      * Handle the User "deleted" event.
      */
-    public function deleted(User $user): void
+    public function deleted(User $user) : void
     {
         // DB has cascade delete enabled to flush 2FA and Groups but,
         // for an unknown reason, SQLite refuses to delete these related.
@@ -82,7 +82,7 @@ class UserObserver
     /**
      * Handle the User "restored" event.
      */
-    public function restored(User $user): void
+    public function restored(User $user) : void
     {
         //
     }
@@ -90,7 +90,7 @@ class UserObserver
     /**
      * Handle the User "force deleted" event.
      */
-    public function forceDeleted(User $user): void
+    public function forceDeleted(User $user) : void
     {
         //
     }

+ 7 - 7
app/Policies/UserPolicy.php

@@ -12,19 +12,19 @@ class UserPolicy
     /**
      * Perform pre-authorization checks.
      */
-    public function before(User $user, string $ability): bool|null
+    public function before(User $user, string $ability) : ?bool
     {
         if ($user->isAdministrator()) {
             return true;
         }
-    
+
         return null;
     }
 
     /**
      * Determine whether the user can view any models.
      */
-    public function viewAny(User $user): bool
+    public function viewAny(User $user) : bool
     {
         return false;
     }
@@ -32,7 +32,7 @@ class UserPolicy
     /**
      * Determine whether the user can view the model.
      */
-    public function view(User $user, User $model): bool
+    public function view(User $user, User $model) : bool
     {
         $can = $this->isHimself($user, $model);
 
@@ -46,7 +46,7 @@ class UserPolicy
     /**
      * Determine whether the user can create models.
      */
-    public function create(?User $user): bool
+    public function create(?User $user) : bool
     {
         return true;
     }
@@ -54,7 +54,7 @@ class UserPolicy
     /**
      * Determine whether the user can update the model.
      */
-    public function update(User $user, User $model): bool
+    public function update(User $user, User $model) : bool
     {
         $can = $this->isHimself($user, $model);
 
@@ -68,7 +68,7 @@ class UserPolicy
     /**
      * Determine whether the user can delete the model.
      */
-    public function delete(User $user, User $model): bool
+    public function delete(User $user, User $model) : bool
     {
         $can = $this->isHimself($user, $model);
 

+ 0 - 1
app/Providers/AppServiceProvider.php

@@ -3,7 +3,6 @@
 namespace App\Providers;
 
 use Illuminate\Http\Resources\Json\JsonResource;
-use Illuminate\Support\Facades\Blade;
 use Illuminate\Support\Facades\Schema;
 use Illuminate\Support\ServiceProvider;
 use Laravel\Passport\Console\ClientCommand;

+ 5 - 5
app/Providers/EventServiceProvider.php

@@ -50,12 +50,12 @@ class EventServiceProvider extends ServiceProvider
             LogNotification::class,
         ],
     ];
-    
+
     /**
-    * The model observers for your application.
-    *
-    * @var array<string, string|object|array<int, string|object>>
-    */
+     * The model observers for your application.
+     *
+     * @var array<string, string|object|array<int, string|object>>
+     */
     protected $observers = [
         User::class => [UserObserver::class],
     ];

+ 3 - 4
app/Rules/ComplyWithEmailRestrictionPolicy.php

@@ -11,11 +11,11 @@ class ComplyWithEmailRestrictionPolicy implements ValidationRule
     /**
      * Run the validation rule.
      */
-    public function validate(string $attribute, mixed $value, Closure $fail): void
+    public function validate(string $attribute, mixed $value, Closure $fail) : void
     {
         $list  = Settings::get('restrictList');
         $regex = Settings::get('restrictRule');
-        
+
         $validatesFilter = true;
         $validatesRegex  = true;
 
@@ -31,8 +31,7 @@ class ComplyWithEmailRestrictionPolicy implements ValidationRule
                 if (! $validatesFilter && ! $validatesRegex) {
                     $fail('validation.custom.email.ComplyWithEmailRestrictionPolicy')->translate();
                 }
-            }
-            else {
+            } else {
                 if (! $validatesFilter || ! $validatesRegex) {
                     $fail('validation.custom.email.ComplyWithEmailRestrictionPolicy')->translate();
                 }

+ 1 - 1
app/Rules/IsValideEmailList.php

@@ -11,7 +11,7 @@ class IsValideEmailList implements ValidationRule
     /**
      * Run the validation rule.
      */
-    public function validate(string $attribute, mixed $value, Closure $fail): void
+    public function validate(string $attribute, mixed $value, Closure $fail) : void
     {
         $emails = explode('|', $value);
 

+ 1 - 1
routes/api/v1.php

@@ -32,7 +32,7 @@ Route::group(['middleware' => 'auth:api-guard'], function () {
     Route::get('user/preferences/{preferenceName}', [UserController::class, 'showPreference'])->name('user.preferences.show');
     Route::get('user/preferences', [UserController::class, 'allPreferences'])->name('user.preferences.all');
     Route::put('user/preferences/{preferenceName}', [UserController::class, 'setPreference'])->name('user.preferences.set');
-    
+
     Route::delete('twofaccounts', [TwoFAccountController::class, 'batchDestroy'])->name('twofaccounts.batchDestroy');
     Route::patch('twofaccounts/withdraw', [TwoFAccountController::class, 'withdraw'])->name('twofaccounts.withdraw');
     Route::post('twofaccounts/reorder', [TwoFAccountController::class, 'reorder'])->name('twofaccounts.reorder');

+ 1 - 1
routes/web.php

@@ -76,7 +76,7 @@ Route::group(['middleware' => ['behind-auth', 'rejectIfReverseProxy']], function
 /**
  * Routes protected by an authentication guard and restricted to administrators
  */
-Route::group(['middleware' => ['behind-auth', 'admin']], function () {   
+Route::group(['middleware' => ['behind-auth', 'admin']], function () {
     Route::get('system/infos', [SystemController::class, 'infos'])->name('system.infos');
     Route::post('system/test-email', [SystemController::class, 'testEmail'])->name('system.testEmail');
 });

+ 37 - 39
tests/Api/v1/Controllers/UserManagerControllerTest.php

@@ -95,11 +95,11 @@ class UserManagerControllerTest extends FeatureTestCase
     /**
      * @test
      */
-    public function test_index_succeeds_and_returns_UserManagerResource(): void
+    public function test_index_succeeds_and_returns_UserManagerResource() : void
     {
-        $path = '/api/v1/users';
+        $path      = '/api/v1/users';
         $resources = UserManagerResource::collection(User::all());
-        $request  = Request::create($path, 'GET');
+        $request   = Request::create($path, 'GET');
 
         $this->actingAs($this->admin, 'api-guard')
             ->json('GET', $path)
@@ -121,11 +121,11 @@ class UserManagerControllerTest extends FeatureTestCase
     /**
      * @test
      */
-    public function test_show_returns_UserManagerResource(): void
+    public function test_show_returns_UserManagerResource() : void
     {
-        $path = '/api/v1/users/' . $this->user->id;
+        $path      = '/api/v1/users/' . $this->user->id;
         $resources = UserManagerResource::make($this->user);
-        $request  = Request::create($path, 'GET');
+        $request   = Request::create($path, 'GET');
 
         $this->actingAs($this->admin, 'api-guard')
             ->json('GET', $path)
@@ -140,7 +140,7 @@ class UserManagerControllerTest extends FeatureTestCase
         Notification::fake();
 
         DB::table(config('auth.passwords.users.table'))->delete();
-        $user  = User::factory()->create();
+        $user        = User::factory()->create();
         $oldPassword = $user->password;
 
         $this->actingAs($this->admin, 'api-guard')
@@ -165,9 +165,9 @@ class UserManagerControllerTest extends FeatureTestCase
     {
         Notification::fake();
 
-        $user  = User::factory()->create();
-        $path = '/api/v1/users/' . $user->id . '/password/reset';
-        $request  = Request::create($path, 'PATCH');
+        $user    = User::factory()->create();
+        $path    = '/api/v1/users/' . $user->id . '/password/reset';
+        $request = Request::create($path, 'PATCH');
 
         $response = $this->actingAs($this->admin, 'api-guard')
             ->json('PATCH', $path);
@@ -201,7 +201,7 @@ class UserManagerControllerTest extends FeatureTestCase
                 'message',
                 'reason',
             ]);
-        
+
         Notification::assertNothingSent();
     }
 
@@ -232,7 +232,7 @@ class UserManagerControllerTest extends FeatureTestCase
                 'message',
                 'reason',
             ]);
-        
+
         Notification::assertNothingSent();
     }
 
@@ -247,10 +247,10 @@ class UserManagerControllerTest extends FeatureTestCase
                 'email'                 => self::EMAIL,
                 'password'              => self::PASSWORD,
                 'password_confirmation' => self::PASSWORD,
-                'is_admin'              => false
+                'is_admin'              => false,
             ])
             ->assertCreated();
-        
+
         $this->assertDatabaseHas('users', [
             'name'  => self::USERNAME,
             'email' => self::EMAIL,
@@ -260,18 +260,18 @@ class UserManagerControllerTest extends FeatureTestCase
     /**
      * @test
      */
-    public function test_store_returns_UserManagerResource_of_created_user(): void
+    public function test_store_returns_UserManagerResource_of_created_user() : void
     {
-        $path = '/api/v1/users';
-        $userDefinition = (new UserFactory)->definition();
+        $path                                    = '/api/v1/users';
+        $userDefinition                          = (new UserFactory)->definition();
         $userDefinition['password_confirmation'] = $userDefinition['password'];
-        $request  = Request::create($path, 'POST');
+        $request                                 = Request::create($path, 'POST');
 
         $response = $this->actingAs($this->admin, 'api-guard')
             ->json('POST', $path, $userDefinition)
             ->assertCreated();
-            
-        $user = User::where('email', $userDefinition['email'])->first();
+
+        $user     = User::where('email', $userDefinition['email'])->first();
         $resource = UserManagerResource::make($user);
 
         $response->assertExactJson($resource->response($request)->getData(true));
@@ -280,19 +280,19 @@ class UserManagerControllerTest extends FeatureTestCase
     /**
      * @test
      */
-    public function test_store_returns_UserManagerResource_of_created_admin(): void
+    public function test_store_returns_UserManagerResource_of_created_admin() : void
     {
-        $path = '/api/v1/users';
-        $userDefinition = (new UserFactory)->definition();
-        $userDefinition['is_admin'] = true;
+        $path                                    = '/api/v1/users';
+        $userDefinition                          = (new UserFactory)->definition();
+        $userDefinition['is_admin']              = true;
         $userDefinition['password_confirmation'] = $userDefinition['password'];
-        $request  = Request::create($path, 'POST');
+        $request                                 = Request::create($path, 'POST');
 
         $response = $this->actingAs($this->admin, 'api-guard')
             ->json('POST', $path, $userDefinition)
             ->assertCreated();
-            
-        $user = User::where('email', $userDefinition['email'])->first();
+
+        $user     = User::where('email', $userDefinition['email'])->first();
         $resource = UserManagerResource::make($user);
 
         $response->assertExactJson($resource->response($request)->getData(true));
@@ -310,10 +310,10 @@ class UserManagerControllerTest extends FeatureTestCase
                 'name' => 'RandomTokenName',
             ])
             ->assertOk();
-        
+
         $this->actingAs($this->admin, 'api-guard')
             ->json('DELETE', '/api/v1/users/' . $this->user->id . '/pats');
-        
+
         $tokens = $tokenRepository->forUser($this->user->getAuthIdentifier());
         $tokens = $tokens->load('client')->filter(function ($token) {
             return $token->client->personal_access_client && ! $token->revoked;
@@ -423,7 +423,7 @@ class UserManagerControllerTest extends FeatureTestCase
             ->assertNoContent();
 
         $this->user->refresh();
-        
+
         $this->assertFalse($this->user->preferences['useWebauthnOnly']);
     }
 
@@ -452,30 +452,30 @@ class UserManagerControllerTest extends FeatureTestCase
     /**
      * @test
      */
-    public function test_promote_changes_admin_status(): void
+    public function test_promote_changes_admin_status() : void
     {
         $this->actingAs($this->admin, 'api-guard')
             ->json('PATCH', '/api/v1/users/' . $this->user->id . '/promote', [
-                'is_admin' => true
+                'is_admin' => true,
             ])
             ->assertOk();
 
         $this->user->refresh();
-        
+
         $this->assertTrue($this->user->isAdministrator());
     }
 
     /**
      * @test
      */
-    public function test_promote_returns_UserManagerResource(): void
+    public function test_promote_returns_UserManagerResource() : void
     {
-        $path = '/api/v1/users/' . $this->user->id . '/promote';
-        $request  = Request::create($path, 'PUT');
+        $path    = '/api/v1/users/' . $this->user->id . '/promote';
+        $request = Request::create($path, 'PUT');
 
         $response = $this->actingAs($this->admin, 'api-guard')
             ->json('PATCH', $path, [
-                'is_admin' => true
+                'is_admin' => true,
             ]);
 
         $this->user->refresh();
@@ -483,6 +483,4 @@ class UserManagerControllerTest extends FeatureTestCase
 
         $response->assertExactJson($resources->response($request)->getData(true));
     }
-
-
 }

+ 6 - 6
tests/Feature/Http/Auth/RegisterControllerTest.php

@@ -171,7 +171,7 @@ class RegisterControllerTest extends FeatureTestCase
             'password'              => self::PASSWORD,
             'password_confirmation' => self::PASSWORD,
         ])
-        ->assertStatus(201);
+            ->assertStatus(201);
     }
 
     /**
@@ -189,7 +189,7 @@ class RegisterControllerTest extends FeatureTestCase
             'password'              => self::PASSWORD,
             'password_confirmation' => self::PASSWORD,
         ])
-        ->assertStatus(422);
+            ->assertStatus(422);
     }
 
     /**
@@ -207,7 +207,7 @@ class RegisterControllerTest extends FeatureTestCase
             'password'              => self::PASSWORD,
             'password_confirmation' => self::PASSWORD,
         ])
-        ->assertStatus(201);
+            ->assertStatus(201);
     }
 
     /**
@@ -225,7 +225,7 @@ class RegisterControllerTest extends FeatureTestCase
             'password'              => self::PASSWORD,
             'password_confirmation' => self::PASSWORD,
         ])
-        ->assertStatus(422);
+            ->assertStatus(422);
     }
 
     /**
@@ -243,7 +243,7 @@ class RegisterControllerTest extends FeatureTestCase
             'password'              => self::PASSWORD,
             'password_confirmation' => self::PASSWORD,
         ])
-        ->assertStatus(201);
+            ->assertStatus(201);
     }
 
     /**
@@ -261,6 +261,6 @@ class RegisterControllerTest extends FeatureTestCase
             'password'              => self::PASSWORD,
             'password_confirmation' => self::PASSWORD,
         ])
-        ->assertStatus(201);
+            ->assertStatus(201);
     }
 }

+ 2 - 2
tests/Feature/Http/Auth/WebAuthnRecoveryControllerTest.php

@@ -166,10 +166,10 @@ class WebAuthnRecoveryControllerTest extends FeatureTestCase
             'email'    => $this->user->email,
             'password' => UserFactory::USER_PASSWORD,
         ])
-        ->assertStatus(200);
+            ->assertStatus(200);
 
         $this->user->refresh();
-        
+
         $this->assertFalse($this->user->preferences['useWebauthnOnly']);
     }
 

+ 5 - 3
tests/Feature/Http/SystemControllerTest.php

@@ -19,7 +19,9 @@ class SystemControllerTest extends FeatureTestCase
     /**
      * @var \App\Models\User|\Illuminate\Contracts\Auth\Authenticatable
      */
-    protected $user, $admin;
+    protected $user;
+
+    protected $admin;
 
     /**
      * @test
@@ -28,7 +30,7 @@ class SystemControllerTest extends FeatureTestCase
     {
         parent::setUp();
 
-        $this->user = User::factory()->create();
+        $this->user  = User::factory()->create();
         $this->admin = User::factory()->administrator()->create();
     }
 
@@ -77,7 +79,7 @@ class SystemControllerTest extends FeatureTestCase
                     'Auth guard',
                     'webauthn user verification',
                     'Trusted proxies',
-                    'lastRadarScan'
+                    'lastRadarScan',
                 ],
             ]);
     }

+ 1 - 1
tests/Unit/GroupModelTest.php

@@ -30,7 +30,7 @@ class GroupModelTest extends ModelTestCase
             [
                 'id'                 => 'int',
                 'twofaccounts_count' => 'integer',
-                'user_id'            => 'integer'
+                'user_id'            => 'integer',
             ],
             [
                 'deleting' => GroupDeleting::class,

+ 1 - 1
tests/Unit/Listeners/RegisterOpenIdTest.php

@@ -5,8 +5,8 @@ namespace Tests\Unit\Listeners;
 use App\Listeners\RegisterOpenId;
 use App\Providers\Socialite\OpenId;
 use Illuminate\Support\Facades\Event;
-use Laravel\Socialite\SocialiteManager;
 use Laravel\Socialite\Contracts\Factory as SocialiteFactory;
+use Laravel\Socialite\SocialiteManager;
 use PHPUnit\Framework\Attributes\CoversClass;
 use SocialiteProviders\Manager\SocialiteWasCalled;
 use Tests\TestCase;

+ 2 - 2
tests/Unit/TwoFAccountModelTest.php

@@ -34,8 +34,8 @@ class TwoFAccountModelTest extends ModelTestCase
             ['*'],
             [],
             [
-                'id' => 'int',
-                'user_id' => 'integer'
+                'id'      => 'int',
+                'user_id' => 'integer',
             ],
             ['deleted' => TwoFAccountDeleted::class],
             ['created_at', 'updated_at'],