Explorar el Código

Apply Laravel Pint fixes

Bubka hace 2 años
padre
commit
2d706e61b7
Se han modificado 48 ficheros con 245 adiciones y 259 borrados
  1. 3 3
      app/Extensions/WebauthnCredentialBroker.php
  2. 2 4
      app/Helpers/Helpers.php
  3. 3 3
      app/Http/Controllers/Auth/WebAuthnLoginController.php
  4. 2 2
      app/Http/Controllers/Auth/WebAuthnRegisterController.php
  5. 23 24
      app/Models/TwoFAccount.php
  6. 1 0
      app/Providers/TwoFAuthServiceProvider.php
  7. 6 6
      app/Services/LogoService.php
  8. 1 3
      app/Services/Migrators/AegisMigrator.php
  9. 1 1
      app/Services/Migrators/GoogleAuthMigrator.php
  10. 1 1
      app/Services/Migrators/PlainTextMigrator.php
  11. 1 1
      app/Services/Migrators/TwoFASMigrator.php
  12. 4 5
      app/Services/ReleaseRadarService.php
  13. 1 1
      tests/Api/v1/Controllers/Auth/UserControllerTest.php
  14. 1 1
      tests/Api/v1/Controllers/GroupControllerTest.php
  15. 2 2
      tests/Api/v1/Controllers/TwoFAccountControllerTest.php
  16. 4 4
      tests/Api/v1/Requests/GroupAssignRequestTest.php
  17. 4 4
      tests/Api/v1/Requests/GroupStoreRequestTest.php
  18. 4 4
      tests/Api/v1/Requests/QrCodeDecodeRequestTest.php
  19. 4 4
      tests/Api/v1/Requests/SettingStoreRequestTest.php
  20. 4 4
      tests/Api/v1/Requests/SettingUpdateRequestTest.php
  21. 4 4
      tests/Api/v1/Requests/TwoFAccountBatchRequestTest.php
  22. 4 4
      tests/Api/v1/Requests/TwoFAccountImportRequestTest.php
  23. 4 4
      tests/Api/v1/Requests/TwoFAccountReorderRequestTest.php
  24. 4 4
      tests/Api/v1/Requests/TwoFAccountStoreRequestTest.php
  25. 4 4
      tests/Api/v1/Requests/TwoFAccountUpdateRequestTest.php
  26. 4 4
      tests/Api/v1/Requests/TwoFAccountUriRequestTest.php
  27. 6 6
      tests/Feature/Http/Auth/LoginTest.php
  28. 1 1
      tests/Feature/Http/Auth/PasswordControllerTest.php
  29. 2 2
      tests/Feature/Http/Auth/RegisterControllerTest.php
  30. 1 1
      tests/Feature/Http/Auth/UserControllerTest.php
  31. 9 9
      tests/Feature/Http/Auth/WebAuthnDeviceLostControllerTest.php
  32. 21 18
      tests/Feature/Http/Auth/WebAuthnLoginControllerTest.php
  33. 1 1
      tests/Feature/Http/Auth/WebAuthnManageControllerTest.php
  34. 3 3
      tests/Feature/Http/Auth/WebAuthnRecoveryControllerTest.php
  35. 8 9
      tests/Feature/Http/Auth/WebAuthnRegisterControllerTest.php
  36. 2 2
      tests/Feature/Http/SystemControllerTest.php
  37. 14 18
      tests/Feature/Models/TwoFAccountModelTest.php
  38. 1 1
      tests/Feature/Services/GroupServiceTest.php
  39. 7 8
      tests/Feature/Services/LogoServiceTest.php
  40. 1 1
      tests/Feature/Services/QrCodeServiceTest.php
  41. 10 10
      tests/Feature/Services/ReleaseRadarServiceTest.php
  42. 2 2
      tests/Feature/Services/SettingServiceTest.php
  43. 2 2
      tests/Feature/Services/TwoFAccountServiceTest.php
  44. 10 10
      tests/Unit/Exceptions/HandlerTest.php
  45. 3 3
      tests/Unit/HelpersTest.php
  46. 4 5
      tests/Unit/Listeners/DissociateTwofaccountFromGroupTest.php
  47. 39 44
      tests/Unit/MigratorTest.php
  48. 2 2
      tests/Unit/TwoFAccountModelTest.php

+ 3 - 3
app/Extensions/WebauthnCredentialBroker.php

@@ -16,11 +16,11 @@ class WebauthnCredentialBroker extends PasswordBroker
      * @param  \Closure|null  $callback
      * @return string
      */
-    public function sendResetLink(array $credentials, Closure $callback = null): string
+    public function sendResetLink(array $credentials, Closure $callback = null) : string
     {
         $user = $this->getUser($credentials);
 
-        if (!$user instanceof WebAuthnAuthenticatable) {
+        if (! $user instanceof WebAuthnAuthenticatable) {
             return static::INVALID_USER;
         }
 
@@ -50,7 +50,7 @@ class WebauthnCredentialBroker extends PasswordBroker
     {
         $user = $this->validateReset($credentials);
 
-        if (!$user instanceof CanResetPasswordContract || !$user instanceof WebAuthnAuthenticatable) {
+        if (! $user instanceof CanResetPasswordContract || ! $user instanceof WebAuthnAuthenticatable) {
             return $user;
         }
 

+ 2 - 4
app/Helpers/Helpers.php

@@ -2,8 +2,6 @@
 
 namespace App\Helpers;
 
-use Illuminate\Support\Str;
-
 class Helpers
 {
     /**
@@ -12,7 +10,7 @@ class Helpers
      * @param  string|null  $release
      * @return string|false
      */
-    public static function cleanVersionNumber(?string $release): string|false
+    public static function cleanVersionNumber(?string $release) : string|false
     {
         // We use the regex for semver detection (see https://semver.org/)
         return preg_match('/(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?/', $release, $version) ? $version[0] : false;
@@ -24,7 +22,7 @@ class Helpers
      * @param  string  $str
      * @return string The filename
      */
-    public static function PadToBase32Format(?string $str): string
+    public static function PadToBase32Format(?string $str) : string
     {
         return blank($str) ? '' : strtoupper(str_pad($str, (int) ceil(strlen($str) / 8) * 8, '='));
     }

+ 3 - 3
app/Http/Controllers/Auth/WebAuthnLoginController.php

@@ -7,11 +7,11 @@ use App\Models\User;
 use Carbon\Carbon;
 use Illuminate\Contracts\Support\Responsable;
 use Illuminate\Http\JsonResponse;
+use Illuminate\Support\Arr;
 use Illuminate\Support\Facades\Log;
 use Laragear\WebAuthn\Http\Requests\AssertedRequest;
 use Laragear\WebAuthn\Http\Requests\AssertionRequest;
 use Laragear\WebAuthn\WebAuthn;
-use Illuminate\Support\Arr;
 
 class WebAuthnLoginController extends Controller
 {
@@ -32,7 +32,7 @@ class WebAuthnLoginController extends Controller
      * @param  \Laragear\WebAuthn\Http\Requests\AssertionRequest  $request
      * @return \Illuminate\Contracts\Support\Responsable|\Illuminate\Http\JsonResponse
      */
-    public function options(AssertionRequest $request): Responsable|JsonResponse
+    public function options(AssertionRequest $request) : Responsable|JsonResponse
     {
         switch (config('webauthn.user_verification')) {
             case WebAuthn::USER_VERIFICATION_DISCOURAGED:
@@ -70,7 +70,7 @@ class WebAuthnLoginController extends Controller
 
             // Some authenticators do not send a userHandle so we hack the response to be compliant
             // with Larapass/webauthn-lib implementation that waits for a userHandle
-            if (!Arr::exists($response, 'userHandle') || blank($response['userHandle'])) {
+            if (! Arr::exists($response, 'userHandle') || blank($response['userHandle'])) {
                 $response['userHandle'] = User::getFromCredentialId($request->id)?->userHandle();
                 $request->merge(['response' => $response]);
             }

+ 2 - 2
app/Http/Controllers/Auth/WebAuthnRegisterController.php

@@ -17,7 +17,7 @@ class WebAuthnRegisterController extends Controller
      * @param  \Laragear\WebAuthn\Http\Requests\AttestationRequest  $request
      * @return \Illuminate\Contracts\Support\Responsable
      */
-    public function options(AttestationRequest $request): Responsable
+    public function options(AttestationRequest $request) : Responsable
     {
         switch (config('webauthn.user_verification')) {
             case WebAuthn::USER_VERIFICATION_DISCOURAGED:
@@ -40,7 +40,7 @@ class WebAuthnRegisterController extends Controller
      * @param  \Laragear\WebAuthn\Http\Requests\AttestedRequest  $request
      * @return \Illuminate\Http\Response
      */
-    public function register(AttestedRequest $request): Response
+    public function register(AttestedRequest $request) : Response
     {
         $request->save();
 

+ 23 - 24
app/Models/TwoFAccount.php

@@ -22,6 +22,7 @@ use Illuminate\Support\Facades\Http;
 use Illuminate\Support\Facades\Log;
 use Illuminate\Support\Facades\Storage;
 use Illuminate\Support\Facades\Validator;
+use Illuminate\Support\Str;
 use Illuminate\Validation\ValidationException;
 use OTPHP\Factory;
 use OTPHP\HOTP;
@@ -30,7 +31,6 @@ use ParagonIE\ConstantTime\Base32;
 use Spatie\EloquentSortable\Sortable;
 use Spatie\EloquentSortable\SortableTrait;
 use SteamTotp\SteamTotp;
-use Illuminate\Support\Str;
 
 class TwoFAccount extends Model implements Sortable
 {
@@ -144,13 +144,13 @@ class TwoFAccount extends Model implements Sortable
         parent::boot();
 
         static::saving(function (TwoFAccount $twofaccount) {
-            if (!$twofaccount->legacy_uri) {
+            if (! $twofaccount->legacy_uri) {
                 $twofaccount->legacy_uri = $twofaccount->getURI();
             }
-            if ($twofaccount->otp_type == TwoFAccount::TOTP && !$twofaccount->period) {
+            if ($twofaccount->otp_type == TwoFAccount::TOTP && ! $twofaccount->period) {
                 $twofaccount->period = TwoFAccount::DEFAULT_PERIOD;
             }
-            if ($twofaccount->otp_type == TwoFAccount::HOTP && !$twofaccount->counter) {
+            if ($twofaccount->otp_type == TwoFAccount::HOTP && ! $twofaccount->counter) {
                 $twofaccount->counter = TwoFAccount::DEFAULT_COUNTER;
             }
         });
@@ -255,7 +255,7 @@ class TwoFAccount extends Model implements Sortable
      */
     public function setDigitsAttribute($value)
     {
-        $this->attributes['digits'] = !$value ? 6 : $value;
+        $this->attributes['digits'] = ! $value ? 6 : $value;
     }
 
     /**
@@ -266,7 +266,7 @@ class TwoFAccount extends Model implements Sortable
      */
     public function setAlgorithmAttribute($value)
     {
-        $this->attributes['algorithm'] = !$value ? self::SHA1 : strtolower($value);
+        $this->attributes['algorithm'] = ! $value ? self::SHA1 : strtolower($value);
     }
 
     /**
@@ -277,7 +277,7 @@ class TwoFAccount extends Model implements Sortable
      */
     public function setPeriodAttribute($value)
     {
-        $this->attributes['period'] = !$value && $this->otp_type === self::TOTP ? self::DEFAULT_PERIOD : $value;
+        $this->attributes['period'] = ! $value && $this->otp_type === self::TOTP ? self::DEFAULT_PERIOD : $value;
     }
 
     /**
@@ -376,7 +376,7 @@ class TwoFAccount extends Model implements Sortable
             $this->enforceAsSteam();
         }
 
-        if (!$this->icon && Settings::get('getOfficialIcons') && !$skipIconFetching) {
+        if (! $this->icon && Settings::get('getOfficialIcons') && ! $skipIconFetching) {
             $this->icon = $this->getDefaultIcon();
         }
 
@@ -403,7 +403,7 @@ class TwoFAccount extends Model implements Sortable
 
         // As loadFromProvisioningUri() accept URI without label (nor account nor service) we check
         // that the account is set
-        if (!$this->generator->getLabel()) {
+        if (! $this->generator->getLabel()) {
             Log::error('URI passed to fillWithURI() must contain a label');
 
             throw ValidationException::withMessages([
@@ -428,7 +428,7 @@ class TwoFAccount extends Model implements Sortable
             self::setIcon($this->generator->getParameter('image'));
         }
 
-        if (!$this->icon && Settings::get('getOfficialIcons') && !$skipIconFetching) {
+        if (! $this->icon && Settings::get('getOfficialIcons') && ! $skipIconFetching) {
             $this->icon = $this->getDefaultIcon();
         }
 
@@ -440,7 +440,7 @@ class TwoFAccount extends Model implements Sortable
     /**
      * Compare 2 TwoFAccounts
      */
-    public function equals(self $other): bool
+    public function equals(self $other) : bool
     {
         return $this->service === $other->service &&
             $this->account === $other->account &&
@@ -456,7 +456,7 @@ class TwoFAccount extends Model implements Sortable
     /**
      * Sets model attributes to STEAM values
      */
-    private function enforceAsSteam(): void
+    private function enforceAsSteam() : void
     {
         $this->otp_type  = self::STEAM_TOTP;
         $this->digits    = 5;
@@ -479,7 +479,7 @@ class TwoFAccount extends Model implements Sortable
     /**
      * Returns an otpauth URI built with model attribute values
      */
-    public function getURI(): string
+    public function getURI() : string
     {
         $this->initGenerator();
 
@@ -492,7 +492,7 @@ class TwoFAccount extends Model implements Sortable
      * @throws UnsupportedOtpTypeException The defined OTP type is not supported
      * @throws InvalidOtpParameterException One OTP parameter is invalid
      */
-    private function initGenerator(): void
+    private function initGenerator() : void
     {
         try {
             switch ($this->otp_type) {
@@ -538,11 +538,11 @@ class TwoFAccount extends Model implements Sortable
 
     /**
      * Store and set the provided icon
-     * 
+     *
      * @param  \Psr\Http\Message\StreamInterface|\Illuminate\Http\File|\Illuminate\Http\UploadedFile|string|resource  $data
      * @param  string|null  $extension The resource extension, without the dot
      */
-    public function setIcon($data, $extension = null): void
+    public function setIcon($data, $extension = null) : void
     {
         $isRemoteData = Str::startsWith($data, ['http://', 'https://']) && Validator::make(
             [$data],
@@ -565,7 +565,7 @@ class TwoFAccount extends Model implements Sortable
      * @param  string  $extension The file extension, without the dot
      * @return string|null The filename of the stored icon or null if the operation fails
      */
-    private function storeFileDataAsIcon($content, $extension): string|null
+    private function storeFileDataAsIcon($content, $extension) : string|null
     {
         $filename = self::getUniqueFilename($extension);
 
@@ -582,14 +582,13 @@ class TwoFAccount extends Model implements Sortable
         return null;
     }
 
-
     /**
      * Generate a unique filename
      *
      * @param  string  $extension
      * @return string The filename
      */
-    private function getUniqueFilename(string $extension): string
+    private function getUniqueFilename(string $extension) : string
     {
         return Str::random(40) . '.' . $extension;
     }
@@ -601,7 +600,7 @@ class TwoFAccount extends Model implements Sortable
      * @param  string  $disk
      * @return  bool
      */
-    private function isValidIcon($filename, $disk): bool
+    private function isValidIcon($filename, $disk) : bool
     {
         return in_array(Storage::disk($disk)->mimeType($filename), [
             'image/png',
@@ -609,7 +608,7 @@ class TwoFAccount extends Model implements Sortable
             'image/webp',
             'image/bmp',
             'image/x-ms-bmp',
-            'image/svg+xml'
+            'image/svg+xml',
         ]) && (Storage::disk($disk)->mimeType($filename) !== 'image/svg+xml' ? getimagesize(Storage::disk($disk)->path($filename)) : true);
     }
 
@@ -618,7 +617,7 @@ class TwoFAccount extends Model implements Sortable
      *
      * @return string|null The filename of the stored icon or null if the operation fails
      */
-    private function storeRemoteImageAsIcon(string $url): string|null
+    private function storeRemoteImageAsIcon(string $url) : string|null
     {
         try {
             $path_parts  = pathinfo($url);
@@ -672,7 +671,7 @@ class TwoFAccount extends Model implements Sortable
     /**
      * Returns an acceptable value
      */
-    private function decryptOrReturn(mixed $value): mixed
+    private function decryptOrReturn(mixed $value) : mixed
     {
         // Decipher when needed
         if (Settings::get('useEncryption') && $value) {
@@ -689,7 +688,7 @@ class TwoFAccount extends Model implements Sortable
     /**
      * Encrypt a value
      */
-    private function encryptOrReturn(mixed $value): mixed
+    private function encryptOrReturn(mixed $value) : mixed
     {
         // should be replaced by laravel 8 attribute encryption casting
         return Settings::get('useEncryption') ? Crypt::encryptString($value) : $value;

+ 1 - 0
app/Providers/TwoFAuthServiceProvider.php

@@ -50,6 +50,7 @@ class TwoFAuthServiceProvider extends ServiceProvider implements DeferrableProvi
      * Get the services provided by the provider.
      *
      * @codeCoverageIgnore
+     *
      * @return array
      */
     public function provides()

+ 6 - 6
app/Services/LogoService.php

@@ -60,7 +60,7 @@ class LogoService
         $domain       = $this->tfas->get($this->cleanDomain(strval($serviceName)));
         $logoFilename = $domain . '.svg';
 
-        if ($domain && !Storage::disk('logos')->exists($logoFilename)) {
+        if ($domain && ! Storage::disk('logos')->exists($logoFilename)) {
             $this->fetchLogo($logoFilename);
         }
 
@@ -72,7 +72,7 @@ class LogoService
      *
      * @return void
      */
-    protected function setTfaCollection(): void
+    protected function setTfaCollection() : void
     {
         // We fetch a fresh tfaDirectory if necessary to prevent too many API calls
         if (Storage::disk('logos')->exists(self::TFA_JSON)) {
@@ -93,7 +93,7 @@ class LogoService
      *
      * @return void
      */
-    protected function cacheTfaDirectorySource(): void
+    protected function cacheTfaDirectorySource() : void
     {
         try {
             $response = Http::retry(3, 100)->get(self::TFA_URL);
@@ -119,7 +119,7 @@ class LogoService
      * @param  string  $logoFile Logo filename to fetch
      * @return void
      */
-    protected function fetchLogo(string $logoFile): void
+    protected function fetchLogo(string $logoFile) : void
     {
         try {
             $response = Http::retry(3, 100)
@@ -141,7 +141,7 @@ class LogoService
      * @param  string  $domain
      * @return string Optimized domain name
      */
-    protected function cleanDomain(string $domain): string
+    protected function cleanDomain(string $domain) : string
     {
         return strtolower(str_replace(['+'], ['plus'], $domain));
     }
@@ -153,7 +153,7 @@ class LogoService
      * @param  string  $iconFilename
      * @return bool Weither the copy succed or not
      */
-    protected function copyToIcons($logoFilename, $iconFilename): bool
+    protected function copyToIcons($logoFilename, $iconFilename) : bool
     {
         return Storage::disk('icons')->put($iconFilename, Storage::disk('logos')->get($logoFilename));
     }

+ 1 - 3
app/Services/Migrators/AegisMigrator.php

@@ -4,12 +4,10 @@ namespace App\Services\Migrators;
 
 use App\Exceptions\InvalidMigrationDataException;
 use App\Facades\TwoFAccounts;
-use App\Helpers\Helpers;
 use App\Models\TwoFAccount;
 use Illuminate\Support\Arr;
 use Illuminate\Support\Collection;
 use Illuminate\Support\Facades\Log;
-use Illuminate\Support\Facades\Storage;
 
 class AegisMigrator extends Migrator
 {
@@ -38,7 +36,7 @@ class AegisMigrator extends Migrator
      * @param  mixed  $migrationPayload
      * @return \Illuminate\Support\Collection<int|string, \App\Models\TwoFAccount> The converted accounts
      */
-    public function migrate(mixed $migrationPayload): Collection
+    public function migrate(mixed $migrationPayload) : Collection
     {
         $json = json_decode(htmlspecialchars_decode($migrationPayload), true);
 

+ 1 - 1
app/Services/Migrators/GoogleAuthMigrator.php

@@ -23,7 +23,7 @@ class GoogleAuthMigrator extends Migrator
      * @param  mixed  $migrationPayload migration uri provided by Google Authenticator export feature
      * @return \Illuminate\Support\Collection<int|string, \App\Models\TwoFAccount> The converted accounts
      */
-    public function migrate(mixed $migrationPayload): Collection
+    public function migrate(mixed $migrationPayload) : Collection
     {
         try {
             $migrationData = base64_decode(urldecode(Str::replace('otpauth-migration://offline?data=', '', $migrationPayload)));

+ 1 - 1
app/Services/Migrators/PlainTextMigrator.php

@@ -17,7 +17,7 @@ class PlainTextMigrator extends Migrator
      * @param  mixed  $migrationPayload
      * @return \Illuminate\Support\Collection<int|string, \App\Models\TwoFAccount> The converted accounts
      */
-    public function migrate(mixed $migrationPayload): Collection
+    public function migrate(mixed $migrationPayload) : Collection
     {
         $otpauthURIs = preg_split('~\R~', $migrationPayload);
         $otpauthURIs = Arr::where($otpauthURIs, function ($value, $key) {

+ 1 - 1
app/Services/Migrators/TwoFASMigrator.php

@@ -92,7 +92,7 @@ class TwoFASMigrator extends Migrator
             $parameters['counter']   = strtolower($parameters['otp_type']) === 'hotp' && $otp_parameters['otp']['counter'] > 0
                 ? $otp_parameters['otp']['counter']
                 : null;
-            $parameters['period']    = strtolower($parameters['otp_type']) === 'totp' && $otp_parameters['otp']['period'] > 0
+            $parameters['period'] = strtolower($parameters['otp_type']) === 'totp' && $otp_parameters['otp']['period'] > 0
                 ? $otp_parameters['otp']['period']
                 : null;
 

+ 4 - 5
app/Services/ReleaseRadarService.php

@@ -14,7 +14,7 @@ class ReleaseRadarService
      *
      * @return void
      */
-    public function scheduledScan(): void
+    public function scheduledScan() : void
     {
         if ((Settings::get('lastRadarScan') + (60 * 60 * 24 * 7)) < time()) {
             $this->newRelease();
@@ -26,7 +26,7 @@ class ReleaseRadarService
      *
      * @return false|string False if no new release, the new release number otherwise
      */
-    public function manualScan(): false|string
+    public function manualScan() : false|string
     {
         return $this->newRelease();
     }
@@ -36,10 +36,9 @@ class ReleaseRadarService
      *
      * @return false|string False if no new release, the new release number otherwise
      */
-    protected function newRelease(): false|string
+    protected function newRelease() : false|string
     {
         if ($latestReleaseData = json_decode($this->getLatestReleaseData())) {
-
             $githubVersion    = Helpers::cleanVersionNumber($latestReleaseData->tag_name);
             $installedVersion = Helpers::cleanVersionNumber(config('2fauth.version'));
 
@@ -62,7 +61,7 @@ class ReleaseRadarService
      *
      * @return string|null
      */
-    protected function getLatestReleaseData(): string|null
+    protected function getLatestReleaseData() : string|null
     {
         try {
             $response = Http::retry(3, 100)

+ 1 - 1
tests/Api/v1/Controllers/Auth/UserControllerTest.php

@@ -19,7 +19,7 @@ class UserControllerTest extends FeatureTestCase
     /**
      * @test
      */
-    public function setUp(): void
+    public function setUp() : void
     {
         parent::setUp();
 

+ 1 - 1
tests/Api/v1/Controllers/GroupControllerTest.php

@@ -21,7 +21,7 @@ class GroupControllerTest extends FeatureTestCase
     /**
      * @test
      */
-    public function setUp(): void
+    public function setUp() : void
     {
         parent::setUp();
 

+ 2 - 2
tests/Api/v1/Controllers/TwoFAccountControllerTest.php

@@ -9,9 +9,9 @@ use App\Models\User;
 use Illuminate\Support\Facades\DB;
 use Illuminate\Support\Facades\Storage;
 use Tests\Classes\LocalFile;
+use Tests\Data\MigrationTestData;
 use Tests\Data\OtpTestData;
 use Tests\FeatureTestCase;
-use Tests\Data\MigrationTestData;
 
 /**
  * @covers \App\Api\v1\Controllers\TwoFAccountController
@@ -125,7 +125,7 @@ class TwoFAccountControllerTest extends FeatureTestCase
     /**
      * @test
      */
-    public function setUp(): void
+    public function setUp() : void
     {
         parent::setUp();
 

+ 4 - 4
tests/Api/v1/Requests/GroupAssignRequestTest.php

@@ -32,7 +32,7 @@ class GroupAssignRequestTest extends TestCase
     /**
      * @dataProvider provideValidData
      */
-    public function test_valid_data(array $data): void
+    public function test_valid_data(array $data) : void
     {
         $request   = new GroupAssignRequest();
         $validator = Validator::make($data, $request->rules());
@@ -43,7 +43,7 @@ class GroupAssignRequestTest extends TestCase
     /**
      * Provide Valid data for validation test
      */
-    public function provideValidData(): array
+    public function provideValidData() : array
     {
         return [
             [[
@@ -57,7 +57,7 @@ class GroupAssignRequestTest extends TestCase
     /**
      * @dataProvider provideInvalidData
      */
-    public function test_invalid_data(array $data): void
+    public function test_invalid_data(array $data) : void
     {
         $request   = new GroupAssignRequest();
         $validator = Validator::make($data, $request->rules());
@@ -68,7 +68,7 @@ class GroupAssignRequestTest extends TestCase
     /**
      * Provide invalid data for validation test
      */
-    public function provideInvalidData(): array
+    public function provideInvalidData() : array
     {
         return [
             [[

+ 4 - 4
tests/Api/v1/Requests/GroupStoreRequestTest.php

@@ -35,7 +35,7 @@ class GroupStoreRequestTest extends FeatureTestCase
     /**
      * @dataProvider provideValidData
      */
-    public function test_valid_data(array $data): void
+    public function test_valid_data(array $data) : void
     {
         $request   = new GroupStoreRequest();
         $validator = Validator::make($data, $request->rules());
@@ -46,7 +46,7 @@ class GroupStoreRequestTest extends FeatureTestCase
     /**
      * Provide Valid data for validation test
      */
-    public function provideValidData(): array
+    public function provideValidData() : array
     {
         return [
             [[
@@ -58,7 +58,7 @@ class GroupStoreRequestTest extends FeatureTestCase
     /**
      * @dataProvider provideInvalidData
      */
-    public function test_invalid_data(array $data): void
+    public function test_invalid_data(array $data) : void
     {
         $group = new Group([
             'name' => $this->uniqueGroupName,
@@ -75,7 +75,7 @@ class GroupStoreRequestTest extends FeatureTestCase
     /**
      * Provide invalid data for validation test
      */
-    public function provideInvalidData(): array
+    public function provideInvalidData() : array
     {
         return [
             [[

+ 4 - 4
tests/Api/v1/Requests/QrCodeDecodeRequestTest.php

@@ -33,7 +33,7 @@ class QrCodeDecodeRequestTest extends TestCase
     /**
      * @dataProvider provideValidData
      */
-    public function test_valid_data(array $data): void
+    public function test_valid_data(array $data) : void
     {
         $request   = new QrCodeDecodeRequest();
         $validator = Validator::make($data, $request->rules());
@@ -44,7 +44,7 @@ class QrCodeDecodeRequestTest extends TestCase
     /**
      * Provide Valid data for validation test
      */
-    public function provideValidData(): array
+    public function provideValidData() : array
     {
         $file = LocalFile::fake()->validQrcode();
 
@@ -58,7 +58,7 @@ class QrCodeDecodeRequestTest extends TestCase
     /**
      * @dataProvider provideInvalidData
      */
-    public function test_invalid_data(array $data): void
+    public function test_invalid_data(array $data) : void
     {
         $request   = new QrCodeDecodeRequest();
         $validator = Validator::make($data, $request->rules());
@@ -69,7 +69,7 @@ class QrCodeDecodeRequestTest extends TestCase
     /**
      * Provide invalid data for validation test
      */
-    public function provideInvalidData(): array
+    public function provideInvalidData() : array
     {
         return [
             [[

+ 4 - 4
tests/Api/v1/Requests/SettingStoreRequestTest.php

@@ -35,7 +35,7 @@ class SettingStoreRequestTest extends FeatureTestCase
     /**
      * @dataProvider provideValidData
      */
-    public function test_valid_data(array $data): void
+    public function test_valid_data(array $data) : void
     {
         $request   = new SettingStoreRequest();
         $validator = Validator::make($data, $request->rules());
@@ -46,7 +46,7 @@ class SettingStoreRequestTest extends FeatureTestCase
     /**
      * Provide Valid data for validation test
      */
-    public function provideValidData(): array
+    public function provideValidData() : array
     {
         return [
             [[
@@ -67,7 +67,7 @@ class SettingStoreRequestTest extends FeatureTestCase
     /**
      * @dataProvider provideInvalidData
      */
-    public function test_invalid_data(array $data): void
+    public function test_invalid_data(array $data) : void
     {
         Settings::set($this->uniqueKey, 'uniqueValue');
 
@@ -80,7 +80,7 @@ class SettingStoreRequestTest extends FeatureTestCase
     /**
      * Provide invalid data for validation test
      */
-    public function provideInvalidData(): array
+    public function provideInvalidData() : array
     {
         return [
             [[

+ 4 - 4
tests/Api/v1/Requests/SettingUpdateRequestTest.php

@@ -32,7 +32,7 @@ class SettingUpdateRequestTest extends TestCase
     /**
      * @dataProvider provideValidData
      */
-    public function test_valid_data(array $data): void
+    public function test_valid_data(array $data) : void
     {
         $request   = new SettingUpdateRequest();
         $validator = Validator::make($data, $request->rules());
@@ -43,7 +43,7 @@ class SettingUpdateRequestTest extends TestCase
     /**
      * Provide Valid data for validation test
      */
-    public function provideValidData(): array
+    public function provideValidData() : array
     {
         return [
             [[
@@ -61,7 +61,7 @@ class SettingUpdateRequestTest extends TestCase
     /**
      * @dataProvider provideInvalidData
      */
-    public function test_invalid_data(array $data): void
+    public function test_invalid_data(array $data) : void
     {
         $request   = new SettingUpdateRequest();
         $validator = Validator::make($data, $request->rules());
@@ -72,7 +72,7 @@ class SettingUpdateRequestTest extends TestCase
     /**
      * Provide invalid data for validation test
      */
-    public function provideInvalidData(): array
+    public function provideInvalidData() : array
     {
         return [
             [[

+ 4 - 4
tests/Api/v1/Requests/TwoFAccountBatchRequestTest.php

@@ -32,7 +32,7 @@ class TwoFAccountBatchRequestTest extends TestCase
     /**
      * @dataProvider provideValidData
      */
-    public function test_valid_data(array $data): void
+    public function test_valid_data(array $data) : void
     {
         $request   = new TwoFAccountBatchRequest();
         $validator = Validator::make($data, $request->rules());
@@ -43,7 +43,7 @@ class TwoFAccountBatchRequestTest extends TestCase
     /**
      * Provide Valid data for validation test
      */
-    public function provideValidData(): array
+    public function provideValidData() : array
     {
         return [
             [[
@@ -58,7 +58,7 @@ class TwoFAccountBatchRequestTest extends TestCase
     /**
      * @dataProvider provideInvalidData
      */
-    public function test_invalid_data(array $data): void
+    public function test_invalid_data(array $data) : void
     {
         $request   = new TwoFAccountBatchRequest();
         $validator = Validator::make($data, $request->rules());
@@ -69,7 +69,7 @@ class TwoFAccountBatchRequestTest extends TestCase
     /**
      * Provide invalid data for validation test
      */
-    public function provideInvalidData(): array
+    public function provideInvalidData() : array
     {
         return [
             [[

+ 4 - 4
tests/Api/v1/Requests/TwoFAccountImportRequestTest.php

@@ -32,7 +32,7 @@ class TwoFAccountImportRequestTest extends TestCase
     /**
      * @dataProvider provideValidData
      */
-    public function test_valid_data(array $data): void
+    public function test_valid_data(array $data) : void
     {
         $request   = new TwoFAccountImportRequest();
         $validator = Validator::make($data, $request->rules());
@@ -43,7 +43,7 @@ class TwoFAccountImportRequestTest extends TestCase
     /**
      * Provide Valid data for validation test
      */
-    public function provideValidData(): array
+    public function provideValidData() : array
     {
         return [
             [[
@@ -55,7 +55,7 @@ class TwoFAccountImportRequestTest extends TestCase
     /**
      * @dataProvider provideInvalidData
      */
-    public function test_invalid_data(array $data): void
+    public function test_invalid_data(array $data) : void
     {
         $request   = new TwoFAccountImportRequest();
         $validator = Validator::make($data, $request->rules());
@@ -66,7 +66,7 @@ class TwoFAccountImportRequestTest extends TestCase
     /**
      * Provide invalid data for validation test
      */
-    public function provideInvalidData(): array
+    public function provideInvalidData() : array
     {
         return [
             [[

+ 4 - 4
tests/Api/v1/Requests/TwoFAccountReorderRequestTest.php

@@ -32,7 +32,7 @@ class TwoFAccountReorderRequestTest extends TestCase
     /**
      * @dataProvider provideValidData
      */
-    public function test_valid_data(array $data): void
+    public function test_valid_data(array $data) : void
     {
         $request   = new TwoFAccountReorderRequest();
         $validator = Validator::make($data, $request->rules());
@@ -43,7 +43,7 @@ class TwoFAccountReorderRequestTest extends TestCase
     /**
      * Provide Valid data for validation test
      */
-    public function provideValidData(): array
+    public function provideValidData() : array
     {
         return [
             [[
@@ -58,7 +58,7 @@ class TwoFAccountReorderRequestTest extends TestCase
     /**
      * @dataProvider provideInvalidData
      */
-    public function test_invalid_data(array $data): void
+    public function test_invalid_data(array $data) : void
     {
         $request   = new TwoFAccountReorderRequest();
         $validator = Validator::make($data, $request->rules());
@@ -69,7 +69,7 @@ class TwoFAccountReorderRequestTest extends TestCase
     /**
      * Provide invalid data for validation test
      */
-    public function provideInvalidData(): array
+    public function provideInvalidData() : array
     {
         return [
             [[

+ 4 - 4
tests/Api/v1/Requests/TwoFAccountStoreRequestTest.php

@@ -33,7 +33,7 @@ class TwoFAccountStoreRequestTest extends TestCase
     /**
      * @dataProvider provideValidData
      */
-    public function test_valid_data(array $data): void
+    public function test_valid_data(array $data) : void
     {
         $request   = new TwoFAccountStoreRequest();
         $validator = Validator::make($data, $request->rules());
@@ -44,7 +44,7 @@ class TwoFAccountStoreRequestTest extends TestCase
     /**
      * Provide Valid data for validation test
      */
-    public function provideValidData(): array
+    public function provideValidData() : array
     {
         return [
             [[
@@ -108,7 +108,7 @@ class TwoFAccountStoreRequestTest extends TestCase
     /**
      * @dataProvider provideInvalidData
      */
-    public function test_invalid_data(array $data): void
+    public function test_invalid_data(array $data) : void
     {
         $request   = new TwoFAccountStoreRequest();
         $validator = Validator::make($data, $request->rules());
@@ -119,7 +119,7 @@ class TwoFAccountStoreRequestTest extends TestCase
     /**
      * Provide invalid data for validation test
      */
-    public function provideInvalidData(): array
+    public function provideInvalidData() : array
     {
         return [
             [[

+ 4 - 4
tests/Api/v1/Requests/TwoFAccountUpdateRequestTest.php

@@ -33,7 +33,7 @@ class TwoFAccountUpdateRequestTest extends TestCase
     /**
      * @dataProvider provideValidData
      */
-    public function test_valid_data(array $data): void
+    public function test_valid_data(array $data) : void
     {
         $request   = new TwoFAccountUpdateRequest();
         $validator = Validator::make($data, $request->rules());
@@ -44,7 +44,7 @@ class TwoFAccountUpdateRequestTest extends TestCase
     /**
      * Provide Valid data for validation test
      */
-    public function provideValidData(): array
+    public function provideValidData() : array
     {
         return [
             [[
@@ -84,7 +84,7 @@ class TwoFAccountUpdateRequestTest extends TestCase
     /**
      * @dataProvider provideInvalidData
      */
-    public function test_invalid_data(array $data): void
+    public function test_invalid_data(array $data) : void
     {
         $request   = new TwoFAccountUpdateRequest();
         $validator = Validator::make($data, $request->rules());
@@ -95,7 +95,7 @@ class TwoFAccountUpdateRequestTest extends TestCase
     /**
      * Provide invalid data for validation test
      */
-    public function provideInvalidData(): array
+    public function provideInvalidData() : array
     {
         return [
             [[

+ 4 - 4
tests/Api/v1/Requests/TwoFAccountUriRequestTest.php

@@ -32,7 +32,7 @@ class TwoFAccountUriRequestTest extends TestCase
     /**
      * @dataProvider provideValidData
      */
-    public function test_valid_data(array $data): void
+    public function test_valid_data(array $data) : void
     {
         $request   = new TwoFAccountUriRequest();
         $validator = Validator::make($data, $request->rules());
@@ -43,7 +43,7 @@ class TwoFAccountUriRequestTest extends TestCase
     /**
      * Provide Valid data for validation test
      */
-    public function provideValidData(): array
+    public function provideValidData() : array
     {
         return [
             [[
@@ -62,7 +62,7 @@ class TwoFAccountUriRequestTest extends TestCase
     /**
      * @dataProvider provideInvalidData
      */
-    public function test_invalid_data(array $data): void
+    public function test_invalid_data(array $data) : void
     {
         $request   = new TwoFAccountUriRequest();
         $validator = Validator::make($data, $request->rules());
@@ -73,7 +73,7 @@ class TwoFAccountUriRequestTest extends TestCase
     /**
      * Provide invalid data for validation test
      */
-    public function provideInvalidData(): array
+    public function provideInvalidData() : array
     {
         return [
             [[

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

@@ -4,8 +4,8 @@ namespace Tests\Feature\Http\Auth;
 
 use App\Facades\Settings;
 use App\Models\User;
-use Tests\FeatureTestCase;
 use Illuminate\Support\Carbon;
+use Tests\FeatureTestCase;
 
 /**
  * @covers  \App\Http\Controllers\Auth\LoginController
@@ -28,7 +28,7 @@ class LoginTest extends FeatureTestCase
     /**
      * @test
      */
-    public function setUp(): void
+    public function setUp() : void
     {
         parent::setUp();
 
@@ -53,7 +53,7 @@ class LoginTest extends FeatureTestCase
 
     /**
      * @test
-     * 
+     *
      * @covers  \App\Rules\CaseInsensitiveEmailExists
      */
     public function test_user_login_with_uppercased_email_returns_success()
@@ -71,7 +71,7 @@ class LoginTest extends FeatureTestCase
 
     /**
      * @test
-     * 
+     *
      * @covers  \App\Http\Middleware\SkipIfAuthenticated
      */
     public function test_user_login_already_authenticated_returns_bad_request()
@@ -111,7 +111,7 @@ class LoginTest extends FeatureTestCase
 
     /**
      * @test
-     * 
+     *
      * @covers  \App\Exceptions\Handler
      */
     public function test_user_login_with_invalid_credentials_returns_authentication_error()
@@ -184,7 +184,7 @@ class LoginTest extends FeatureTestCase
 
     /**
      * @test
-     * 
+     *
      * @covers  \App\Http\Middleware\KickOutInactiveUser
      * @covers  \App\Http\Middleware\LogUserLastSeen
      */

+ 1 - 1
tests/Feature/Http/Auth/PasswordControllerTest.php

@@ -22,7 +22,7 @@ class PasswordControllerTest extends FeatureTestCase
     /**
      * @test
      */
-    public function setUp(): void
+    public function setUp() : void
     {
         parent::setUp();
 

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

@@ -20,7 +20,7 @@ class RegisterControllerTest extends FeatureTestCase
     /**
      * @test
      */
-    public function setUp(): void
+    public function setUp() : void
     {
         parent::setUp();
     }
@@ -50,7 +50,7 @@ class RegisterControllerTest extends FeatureTestCase
 
     /**
      * @test
-     * 
+     *
      * @covers  \App\Rules\FirstUser
      */
     public function test_register_returns_already_an_existing_user()

+ 1 - 1
tests/Feature/Http/Auth/UserControllerTest.php

@@ -27,7 +27,7 @@ class UserControllerTest extends FeatureTestCase
     /**
      * @test
      */
-    public function setUp(): void
+    public function setUp() : void
     {
         parent::setUp();
 

+ 9 - 9
tests/Feature/Http/Auth/WebAuthnDeviceLostControllerTest.php

@@ -3,10 +3,10 @@
 namespace Tests\Feature\Http\Auth;
 
 use App\Models\User;
-use Illuminate\Support\Facades\Notification;
-use Tests\FeatureTestCase;
 use App\Notifications\WebauthnRecoveryNotification;
 use Illuminate\Support\Facades\Lang;
+use Illuminate\Support\Facades\Notification;
+use Tests\FeatureTestCase;
 
 /**
  * @covers  \App\Http\Controllers\Auth\WebAuthnDeviceLostController
@@ -25,7 +25,7 @@ class WebAuthnDeviceLostControllerTest extends FeatureTestCase
     /**
      * @test
      */
-    public function setUp(): void
+    public function setUp() : void
     {
         parent::setUp();
 
@@ -52,7 +52,7 @@ class WebAuthnDeviceLostControllerTest extends FeatureTestCase
             ]);
 
         $this->assertDatabaseHas('webauthn_recoveries', [
-            'email' => $this->user->email
+            'email' => $this->user->email,
         ]);
     }
 
@@ -113,7 +113,7 @@ class WebAuthnDeviceLostControllerTest extends FeatureTestCase
             ]);
 
         $this->assertDatabaseMissing('webauthn_recoveries', [
-            'email' => 'bad@email.com'
+            'email' => 'bad@email.com',
         ]);
     }
 
@@ -136,7 +136,7 @@ class WebAuthnDeviceLostControllerTest extends FeatureTestCase
             ]);
 
         $this->assertDatabaseMissing('webauthn_recoveries', [
-            'email' => 'bad@email.com'
+            'email' => 'bad@email.com',
         ]);
     }
 
@@ -182,7 +182,7 @@ class WebAuthnDeviceLostControllerTest extends FeatureTestCase
             ]);
 
         $this->assertDatabaseHas('webauthn_recoveries', [
-            'email' => $this->user->email
+            'email' => $this->user->email,
         ]);
 
         $this->json('POST', '/webauthn/lost', [
@@ -191,7 +191,7 @@ class WebAuthnDeviceLostControllerTest extends FeatureTestCase
             ->assertStatus(422)
             ->assertJsonValidationErrorfor('email')
             ->assertJsonFragment([
-                'message' => __('passwords.throttled')
+                'message' => __('passwords.throttled'),
             ]);
     }
 
@@ -203,7 +203,7 @@ class WebAuthnDeviceLostControllerTest extends FeatureTestCase
         $this->app['config']->set('auth.passwords.webauthn', null);
 
         $this->json('POST', '/webauthn/lost', [
-            'email' => $this->user->email
+            'email' => $this->user->email,
         ])
             ->assertStatus(500);
     }

+ 21 - 18
tests/Feature/Http/Auth/WebAuthnLoginControllerTest.php

@@ -3,12 +3,12 @@
 namespace Tests\Feature\Http\Auth;
 
 use App\Models\User;
+use Illuminate\Support\Facades\Config;
 use Illuminate\Support\Facades\DB;
+use Laragear\WebAuthn\Assertion\Validator\AssertionValidator;
 use Laragear\WebAuthn\Http\Requests\AssertedRequest;
-use Tests\FeatureTestCase;
 use Laragear\WebAuthn\WebAuthn;
-use Illuminate\Support\Facades\Config;
-use Laragear\WebAuthn\Assertion\Validator\AssertionValidator;
+use Tests\FeatureTestCase;
 
 /**
  * @covers  \App\Http\Controllers\Auth\WebAuthnLoginController
@@ -22,36 +22,39 @@ class WebAuthnLoginControllerTest extends FeatureTestCase
     protected $user;
 
     const CREDENTIAL_ID = 's06aG41wsIYh5X1YUhB-SlH8y3F2RzdJZVse8iXRXOCd3oqQdEyCOsBawzxrYBtJRQA2azAMEN_q19TUp6iMgg';
+
     const CREDENTIAL_ID_ALT = '-VOLFKPY-_FuMI_sJ7gMllK76L3VoRUINj6lL_Z3qDg';
+
     const CREDENTIAL_ID_ALT_RAW = '+VOLFKPY+/FuMI/sJ7gMllK76L3VoRUINj6lL/Z3qDg=';
 
     const PUBLIC_KEY = 'eyJpdiI6ImYyUHlJOEJML0pwTXJ2UDkveTQwZFE9PSIsInZhbHVlIjoiQWFSYi9LVEszazlBRUZsWHp0cGNRNktGeEQ3aTBsbU9zZ1g5MEgrWFJJNmgraElsNU9hV0VsRVlWc3NoUVVHUjRRdlcxTS9pVklnOWtVYWY5TFJQTTFhR1Rxb1ZzTFkxTWE4VUVvK1lyU3pYQ1M3VlBMWWxZcDVaYWFnK25iaXVyWGR6ZFRmMFVoSmdPZ3UvSnptbVZER0FYdEEyYmNYcW43RkV5aTVqSjNwZEFsUjhUYSs0YjU2Z2V2bUJXa0E0aVB1VC8xSjdJZ2llRGlHY2RwOGk3MmNPTyt6eDFDWUs1dVBOSWp1ZUFSeUlkclgwRW16RE9sUUpDSWV6Sk50TSIsIm1hYyI6IjI3ODQ5NzcxZGY1MzMwYTNiZjAwZmEwMDJkZjYzMGU4N2UzZjZlOGM0ZWE3NDkyYWMxMThhNmE5NWZiMTVjNGEiLCJ0YWciOiIifQ==';
 
     const USER_ID = '3b758ac868b74307a7e96e69ae187339';
+
     const USER_ID_ALT = 'e8af6f703f8042aa91c30cf72289aa07';
 
     const ASSERTION_RESPONSE = [
-        'id' => self::CREDENTIAL_ID_ALT,
-        'rawId' => self::CREDENTIAL_ID_ALT_RAW,
-        'type' => 'public-key',
+        'id'       => self::CREDENTIAL_ID_ALT,
+        'rawId'    => self::CREDENTIAL_ID_ALT_RAW,
+        'type'     => 'public-key',
         'response' => [
-            'clientDataJSON' => 'eyJ0eXBlIjoid2ViYXV0aG4uZ2V0IiwiY2hhbGxlbmdlIjoiaVhvem15bktpLVlEMmlSdktOYlNQQSIsIm9yaWdpbiI6Imh0dHA6Ly9sb2NhbGhvc3QiLCJjcm9zc09yaWdpbiI6ZmFsc2V9',
+            'clientDataJSON'    => 'eyJ0eXBlIjoid2ViYXV0aG4uZ2V0IiwiY2hhbGxlbmdlIjoiaVhvem15bktpLVlEMmlSdktOYlNQQSIsIm9yaWdpbiI6Imh0dHA6Ly9sb2NhbGhvc3QiLCJjcm9zc09yaWdpbiI6ZmFsc2V9',
             'authenticatorData' => 'SZYN5YgOjGh0NBcPZHZgW4/krrmihjLHmVzzuoMdl2MFAAAAAQ==',
-            'signature' => 'ca4IJ9h8bZnjMbEFuHX1zfX5LcbiPyDVz6sD1/ppR4t8++1DxKa5EdBIrfNlo8FSOv/JSzMrGGUCQvc/Ngj1KnZpO3s9OdTb54/gMDewH/K8EG4wSvxzHdL6sMbP7UUc5Wq1pcdu9MgXY8V+1gftXpzcoaae0X+mLEETgU7eB8jG0mZhVWvE4yQKuDnZA1i9r8oQhqsvG4nUw1BxvR8wAGiRR+R287LaL41k+xum5mS8zEojUmuLSH50miyVxZ4Y+/oyfxG7i+wSYGNSXlW5iNPB+2WupGS7ce4TuOgaFeMmP2a9rzP4m2IBSQoJ2FyrdzR7HwBEewqqrUVbGQw3Aw==',
-            'userHandle' => self::USER_ID_ALT,
-        ]
+            'signature'         => 'ca4IJ9h8bZnjMbEFuHX1zfX5LcbiPyDVz6sD1/ppR4t8++1DxKa5EdBIrfNlo8FSOv/JSzMrGGUCQvc/Ngj1KnZpO3s9OdTb54/gMDewH/K8EG4wSvxzHdL6sMbP7UUc5Wq1pcdu9MgXY8V+1gftXpzcoaae0X+mLEETgU7eB8jG0mZhVWvE4yQKuDnZA1i9r8oQhqsvG4nUw1BxvR8wAGiRR+R287LaL41k+xum5mS8zEojUmuLSH50miyVxZ4Y+/oyfxG7i+wSYGNSXlW5iNPB+2WupGS7ce4TuOgaFeMmP2a9rzP4m2IBSQoJ2FyrdzR7HwBEewqqrUVbGQw3Aw==',
+            'userHandle'        => self::USER_ID_ALT,
+        ],
     ];
 
     const ASSERTION_RESPONSE_NO_HANDLE = [
-        'id' => self::CREDENTIAL_ID_ALT,
-        'rawId' => self::CREDENTIAL_ID_ALT_RAW,
-        'type' => 'public-key',
+        'id'       => self::CREDENTIAL_ID_ALT,
+        'rawId'    => self::CREDENTIAL_ID_ALT_RAW,
+        'type'     => 'public-key',
         'response' => [
-            'clientDataJSON' => 'eyJ0eXBlIjoid2ViYXV0aG4uZ2V0IiwiY2hhbGxlbmdlIjoiaVhvem15bktpLVlEMmlSdktOYlNQQSIsIm9yaWdpbiI6Imh0dHA6Ly9sb2NhbGhvc3QiLCJjcm9zc09yaWdpbiI6ZmFsc2V9',
+            'clientDataJSON'    => 'eyJ0eXBlIjoid2ViYXV0aG4uZ2V0IiwiY2hhbGxlbmdlIjoiaVhvem15bktpLVlEMmlSdktOYlNQQSIsIm9yaWdpbiI6Imh0dHA6Ly9sb2NhbGhvc3QiLCJjcm9zc09yaWdpbiI6ZmFsc2V9',
             'authenticatorData' => 'SZYN5YgOjGh0NBcPZHZgW4/krrmihjLHmVzzuoMdl2MFAAAAAQ==',
-            'signature' => 'ca4IJ9h8bZnjMbEFuHX1zfX5LcbiPyDVz6sD1/ppR4t8++1DxKa5EdBIrfNlo8FSOv/JSzMrGGUCQvc/Ngj1KnZpO3s9OdTb54/gMDewH/K8EG4wSvxzHdL6sMbP7UUc5Wq1pcdu9MgXY8V+1gftXpzcoaae0X+mLEETgU7eB8jG0mZhVWvE4yQKuDnZA1i9r8oQhqsvG4nUw1BxvR8wAGiRR+R287LaL41k+xum5mS8zEojUmuLSH50miyVxZ4Y+/oyfxG7i+wSYGNSXlW5iNPB+2WupGS7ce4TuOgaFeMmP2a9rzP4m2IBSQoJ2FyrdzR7HwBEewqqrUVbGQw3Aw==',
-            'userHandle' => null,
-        ]
+            'signature'         => 'ca4IJ9h8bZnjMbEFuHX1zfX5LcbiPyDVz6sD1/ppR4t8++1DxKa5EdBIrfNlo8FSOv/JSzMrGGUCQvc/Ngj1KnZpO3s9OdTb54/gMDewH/K8EG4wSvxzHdL6sMbP7UUc5Wq1pcdu9MgXY8V+1gftXpzcoaae0X+mLEETgU7eB8jG0mZhVWvE4yQKuDnZA1i9r8oQhqsvG4nUw1BxvR8wAGiRR+R287LaL41k+xum5mS8zEojUmuLSH50miyVxZ4Y+/oyfxG7i+wSYGNSXlW5iNPB+2WupGS7ce4TuOgaFeMmP2a9rzP4m2IBSQoJ2FyrdzR7HwBEewqqrUVbGQw3Aw==',
+            'userHandle'        => null,
+        ],
     ];
 
     const ASSERTION_CHALLENGE = 'iXozmynKi+YD2iRvKNbSPA==';
@@ -59,7 +62,7 @@ class WebAuthnLoginControllerTest extends FeatureTestCase
     /**
      * @test
      */
-    public function setUp(): void
+    public function setUp() : void
     {
         parent::setUp();
 

+ 1 - 1
tests/Feature/Http/Auth/WebAuthnManageControllerTest.php

@@ -28,7 +28,7 @@ class WebAuthnManageControllerTest extends FeatureTestCase
     /**
      * @test
      */
-    public function setUp(): void
+    public function setUp() : void
     {
         parent::setUp();
 

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

@@ -35,7 +35,7 @@ class WebAuthnRecoveryControllerTest extends FeatureTestCase
     /**
      * @test
      */
-    public function setUp(): void
+    public function setUp() : void
     {
         parent::setUp();
 
@@ -96,8 +96,8 @@ class WebAuthnRecoveryControllerTest extends FeatureTestCase
         ]);
 
         $this->json('POST', '/webauthn/recover', [
-            'token' => self::ACTUAL_TOKEN_VALUE,
-            'email' => $this->user->email,
+            'token'    => self::ACTUAL_TOKEN_VALUE,
+            'email'    => $this->user->email,
             'password' => UserFactory::USER_PASSWORD,
         ])
             ->assertStatus(422)

+ 8 - 9
tests/Feature/Http/Auth/WebAuthnRegisterControllerTest.php

@@ -3,19 +3,18 @@
 namespace Tests\Feature\Http\Auth;
 
 use App\Models\User;
-use Tests\FeatureTestCase;
-use Laragear\WebAuthn\Http\Requests\AttestedRequest;
-use Laragear\WebAuthn\Http\Requests\AttestationRequest;
 use Illuminate\Support\Facades\Config;
-use Laragear\WebAuthn\WebAuthn;
+use Laragear\WebAuthn\Http\Requests\AttestationRequest;
+use Laragear\WebAuthn\Http\Requests\AttestedRequest;
 use Laragear\WebAuthn\JsonTransport;
+use Laragear\WebAuthn\WebAuthn;
+use Tests\FeatureTestCase;
 
 /**
  * @covers  \App\Http\Controllers\Auth\WebAuthnRegisterController
  */
 class WebAuthnRegisterControllerTest extends FeatureTestCase
 {
-
     /**
      * @var \App\Models\User
      */
@@ -24,7 +23,7 @@ class WebAuthnRegisterControllerTest extends FeatureTestCase
     /**
      * @test
      */
-    public function setUp(): void
+    public function setUp() : void
     {
         parent::setUp();
 
@@ -34,7 +33,7 @@ class WebAuthnRegisterControllerTest extends FeatureTestCase
     /**
      * @test
      */
-    public function test_uses_attestation_with_fastRegistration_request(): void
+    public function test_uses_attestation_with_fastRegistration_request() : void
     {
         Config::set('webauthn.user_verification', WebAuthn::USER_VERIFICATION_DISCOURAGED);
 
@@ -51,7 +50,7 @@ class WebAuthnRegisterControllerTest extends FeatureTestCase
     /**
      * @test
      */
-    public function test_uses_attestation_with_secureRegistration_request(): void
+    public function test_uses_attestation_with_secureRegistration_request() : void
     {
         Config::set('webauthn.user_verification', WebAuthn::USER_VERIFICATION_REQUIRED);
 
@@ -68,7 +67,7 @@ class WebAuthnRegisterControllerTest extends FeatureTestCase
     /**
      * @test
      */
-    public function test_register_uses_attested_request(): void
+    public function test_register_uses_attested_request() : void
     {
         $this->mock(AttestedRequest::class)->expects('save')->andReturn();
 

+ 2 - 2
tests/Feature/Http/SystemControllerTest.php

@@ -3,8 +3,8 @@
 namespace Tests\Feature\Http;
 
 use App\Models\User;
-use Illuminate\Foundation\Testing\WithoutMiddleware;
 use App\Services\ReleaseRadarService;
+use Illuminate\Foundation\Testing\WithoutMiddleware;
 use Tests\FeatureTestCase;
 
 /**
@@ -22,7 +22,7 @@ class SystemControllerTest extends FeatureTestCase
     /**
      * @test
      */
-    public function setUp(): void
+    public function setUp() : void
     {
         parent::setUp();
 

+ 14 - 18
tests/Feature/Models/TwoFAccountModelTest.php

@@ -3,13 +3,12 @@
 namespace Tests\Feature\Models;
 
 use App\Models\TwoFAccount;
-use Tests\Data\OtpTestData;
-use Tests\FeatureTestCase;
-use Illuminate\Support\Facades\Storage;
 use Illuminate\Http\Testing\FileFactory;
-use Illuminate\Http\UploadedFile;
 use Illuminate\Support\Facades\Http;
+use Illuminate\Support\Facades\Storage;
 use Tests\Data\HttpRequestTestData;
+use Tests\Data\OtpTestData;
+use Tests\FeatureTestCase;
 
 /**
  * @covers \App\Models\TwoFAccount
@@ -28,14 +27,13 @@ class TwoFAccountModelTest extends FeatureTestCase
 
     /**
      * Helpers $helpers;
-
      */
     protected $helpers;
 
     /**
      * @test
      */
-    public function setUp(): void
+    public function setUp() : void
     {
         parent::setUp();
 
@@ -461,7 +459,6 @@ class TwoFAccountModelTest extends FeatureTestCase
      */
     public function test_getOTP_for_hotp_returns_the_same_password()
     {
-
         Http::preventStrayRequests();
         Http::fake([
             'https://en.opensuse.org/images/4/44/Button-filled-colour.png' => Http::response(HttpRequestTestData::ICON_PNG, 200),
@@ -567,7 +564,6 @@ class TwoFAccountModelTest extends FeatureTestCase
      */
     public function test_fill_succeed_when_image_fetching_fails()
     {
-
         Http::preventStrayRequests();
 
         Storage::fake('imagesLink');
@@ -585,11 +581,11 @@ class TwoFAccountModelTest extends FeatureTestCase
      */
     public function test_saving_totp_without_period_set_default_one()
     {
-        $twofaccount = new TwoFAccount;
-        $twofaccount->service = OtpTestData::SERVICE;
-        $twofaccount->account = OtpTestData::ACCOUNT;
+        $twofaccount           = new TwoFAccount;
+        $twofaccount->service  = OtpTestData::SERVICE;
+        $twofaccount->account  = OtpTestData::ACCOUNT;
         $twofaccount->otp_type = TwoFAccount::TOTP;
-        $twofaccount->secret = OtpTestData::SECRET;
+        $twofaccount->secret   = OtpTestData::SECRET;
 
         $twofaccount->save();
 
@@ -603,11 +599,11 @@ class TwoFAccountModelTest extends FeatureTestCase
      */
     public function test_saving_hotp_without_counter_set_default_one()
     {
-        $twofaccount = new TwoFAccount;
-        $twofaccount->service = OtpTestData::SERVICE;
-        $twofaccount->account = OtpTestData::ACCOUNT;
+        $twofaccount           = new TwoFAccount;
+        $twofaccount->service  = OtpTestData::SERVICE;
+        $twofaccount->account  = OtpTestData::ACCOUNT;
         $twofaccount->otp_type = TwoFAccount::HOTP;
-        $twofaccount->secret = OtpTestData::SECRET;
+        $twofaccount->secret   = OtpTestData::SECRET;
 
         $twofaccount->save();
 
@@ -660,7 +656,7 @@ class TwoFAccountModelTest extends FeatureTestCase
 
     /**
      * @test
-     * 
+     *
      * @dataProvider iconResourceProvider
      */
     public function test_set_icon_stores_and_set_the_icon($res, $ext)
@@ -708,7 +704,7 @@ class TwoFAccountModelTest extends FeatureTestCase
 
     /**
      * @test
-     * 
+     *
      * @dataProvider invalidIconResourceProvider
      */
     public function test_set_invalid_icon_ends_without_error($res, $ext)

+ 1 - 1
tests/Feature/Services/GroupServiceTest.php

@@ -53,7 +53,7 @@ class GroupServiceTest extends FeatureTestCase
     /**
      * @test
      */
-    public function setUp(): void
+    public function setUp() : void
     {
         parent::setUp();
 

+ 7 - 8
tests/Feature/Services/LogoServiceTest.php

@@ -4,11 +4,10 @@ namespace Tests\Feature\Services;
 
 use App\Services\LogoService;
 use Illuminate\Foundation\Testing\WithoutMiddleware;
-use Mockery\MockInterface;
-use Tests\TestCase;
-use Illuminate\Support\Facades\Storage;
 use Illuminate\Support\Facades\Http;
+use Illuminate\Support\Facades\Storage;
 use Tests\Data\HttpRequestTestData;
+use Tests\TestCase;
 
 /**
  * @covers \App\Services\LogoService
@@ -20,7 +19,7 @@ class LogoServiceTest extends TestCase
     /**
      * @test
      */
-    public function setUp(): void
+    public function setUp() : void
     {
         parent::setUp();
     }
@@ -30,20 +29,20 @@ class LogoServiceTest extends TestCase
      */
     public function test_getIcon_returns_stored_icon_file_when_logo_exists()
     {
-        $svgLogo = HttpRequestTestData::SVG_LOGO_BODY;
+        $svgLogo     = HttpRequestTestData::SVG_LOGO_BODY;
         $tfaJsonBody = HttpRequestTestData::TFA_JSON_BODY;
 
         Http::preventStrayRequests();
         Http::fake([
             'https://raw.githubusercontent.com/2factorauth/twofactorauth/master/img/*' => Http::response($svgLogo, 200),
-            'https://2fa.directory/api/v3/tfa.json' => Http::response($tfaJsonBody, 200),
+            'https://2fa.directory/api/v3/tfa.json'                                    => Http::response($tfaJsonBody, 200),
         ]);
 
         Storage::fake('icons');
         Storage::fake('logos');
 
         $logoService = new LogoService();
-        $icon = $logoService->getIcon('twitter');
+        $icon        = $logoService->getIcon('twitter');
 
         $this->assertNotNull($icon);
         Storage::disk('icons')->assertExists($icon);
@@ -117,7 +116,7 @@ class LogoServiceTest extends TestCase
         Storage::fake('logos');
 
         $logoService = new LogoService();
-        $icon = $logoService->getIcon('twitter');
+        $icon        = $logoService->getIcon('twitter');
 
         $this->assertNull($icon);
         Storage::disk('logos')->assertMissing(LogoService::TFA_JSON);

+ 1 - 1
tests/Feature/Services/QrCodeServiceTest.php

@@ -21,7 +21,7 @@ class QrCodeServiceTest extends FeatureTestCase
     /**
      * @test
      */
-    public function setUp(): void
+    public function setUp() : void
     {
         parent::setUp();
     }

+ 10 - 10
tests/Feature/Services/ReleaseRadarServiceTest.php

@@ -5,9 +5,9 @@ namespace Tests\Feature\Services;
 use App\Facades\Settings;
 use App\Services\ReleaseRadarService;
 use Illuminate\Foundation\Testing\WithoutMiddleware;
-use Tests\FeatureTestCase;
 use Illuminate\Support\Facades\Http;
 use Tests\Data\HttpRequestTestData;
+use Tests\FeatureTestCase;
 
 /**
  * @covers \App\Services\ReleaseRadarService
@@ -29,15 +29,15 @@ class ReleaseRadarServiceTest extends FeatureTestCase
         ]);
 
         $releaseRadarService = new ReleaseRadarService();
-        $release = $releaseRadarService->manualScan();
+        $release             = $releaseRadarService->manualScan();
 
         $this->assertFalse($release);
         $this->assertDatabaseHas('options', [
-            'key'   => 'lastRadarScan',
+            'key' => 'lastRadarScan',
         ]);
         $this->assertDatabaseMissing('options', [
-            'key' => 'latestRelease',
-            'value' => HttpRequestTestData::TAG_NAME
+            'key'   => 'latestRelease',
+            'value' => HttpRequestTestData::TAG_NAME,
         ]);
     }
 
@@ -54,15 +54,15 @@ class ReleaseRadarServiceTest extends FeatureTestCase
         ]);
 
         $releaseRadarService = new ReleaseRadarService();
-        $release = $releaseRadarService->manualScan();
+        $release             = $releaseRadarService->manualScan();
 
         $this->assertEquals(HttpRequestTestData::NEW_TAG_NAME, $release);
         $this->assertDatabaseHas('options', [
             'key'   => 'latestRelease',
-            'value' => HttpRequestTestData::NEW_TAG_NAME
+            'value' => HttpRequestTestData::NEW_TAG_NAME,
         ]);
         $this->assertDatabaseHas('options', [
-            'key'   => 'lastRadarScan',
+            'key' => 'lastRadarScan',
         ]);
     }
 
@@ -77,7 +77,7 @@ class ReleaseRadarServiceTest extends FeatureTestCase
         Http::preventStrayRequests();
 
         $releaseRadarService = new ReleaseRadarService();
-        $release = $releaseRadarService->manualScan();
+        $release             = $releaseRadarService->manualScan();
 
         $this->assertFalse($release);
     }
@@ -95,7 +95,7 @@ class ReleaseRadarServiceTest extends FeatureTestCase
         ]);
 
         $releaseRadarService = new ReleaseRadarService();
-        $release = $releaseRadarService->manualScan();
+        $release             = $releaseRadarService->manualScan();
 
         $this->assertFalse($release);
     }

+ 2 - 2
tests/Feature/Services/SettingServiceTest.php

@@ -58,7 +58,7 @@ class SettingServiceTest extends FeatureTestCase
     /**
      * @test
      */
-    public function setUp(): void
+    public function setUp() : void
     {
         parent::setUp();
 
@@ -239,7 +239,7 @@ class SettingServiceTest extends FeatureTestCase
     /**
      * Provide invalid data for validation test
      */
-    public function provideUndecipherableData(): array
+    public function provideUndecipherableData() : array
     {
         return [
             [[

+ 2 - 2
tests/Feature/Services/TwoFAccountServiceTest.php

@@ -5,9 +5,9 @@ namespace Tests\Feature\Services;
 use App\Facades\TwoFAccounts;
 use App\Models\Group;
 use App\Models\TwoFAccount;
+use Tests\Data\MigrationTestData;
 use Tests\Data\OtpTestData;
 use Tests\FeatureTestCase;
-use Tests\Data\MigrationTestData;
 
 /**
  * @covers \App\Services\TwoFAccountService
@@ -33,7 +33,7 @@ class TwoFAccountServiceTest extends FeatureTestCase
     /**
      * @test
      */
-    public function setUp(): void
+    public function setUp() : void
     {
         parent::setUp();
 

+ 10 - 10
tests/Unit/Exceptions/HandlerTest.php

@@ -2,20 +2,20 @@
 
 namespace Tests\Unit\Exceptions;
 
+use App\Exceptions\DbEncryptionException;
+use App\Exceptions\EncryptedMigrationException;
 use App\Exceptions\Handler;
-use Illuminate\Contracts\Container\Container;
-use Illuminate\Http\JsonResponse;
-use Illuminate\Http\Request;
-use Tests\TestCase;
+use App\Exceptions\InvalidMigrationDataException;
 use App\Exceptions\InvalidOtpParameterException;
-use \App\Exceptions\InvalidQrCodeException;
+use App\Exceptions\InvalidQrCodeException;
 use App\Exceptions\InvalidSecretException;
-use App\Exceptions\DbEncryptionException;
-use App\Exceptions\InvalidMigrationDataException;
 use App\Exceptions\UndecipherableException;
 use App\Exceptions\UnsupportedMigrationException;
 use App\Exceptions\UnsupportedOtpTypeException;
-use App\Exceptions\EncryptedMigrationException;
+use Illuminate\Contracts\Container\Container;
+use Illuminate\Http\JsonResponse;
+use Illuminate\Http\Request;
+use Tests\TestCase;
 
 /**
  * @covers \App\Exceptions\Handler
@@ -50,7 +50,7 @@ class HandlerTest extends TestCase
     /**
      * Provide Valid data for validation test
      */
-    public function provideExceptionsforBadRequest(): array
+    public function provideExceptionsforBadRequest() : array
     {
         return [
             [
@@ -111,7 +111,7 @@ class HandlerTest extends TestCase
     /**
      * Provide Valid data for validation test
      */
-    public function provideExceptionsforNotFound(): array
+    public function provideExceptionsforNotFound() : array
     {
         return [
             [

+ 3 - 3
tests/Unit/HelpersTest.php

@@ -12,7 +12,7 @@ class HelpersTest extends TestCase
 {
     /**
      * @test
-     * 
+     *
      * @dataProvider  versionNumberProvider
      */
     public function test_cleanVersionNumber_returns_cleaned_version($dirtyVersion, $expected)
@@ -49,7 +49,7 @@ class HelpersTest extends TestCase
 
     /**
      * @test
-     * 
+     *
      * @dataProvider  invalidVersionNumberProvider
      */
     public function test_cleanVersionNumber_returns_false_with_invalid_semver($dirtyVersion)
@@ -85,7 +85,7 @@ class HelpersTest extends TestCase
 
     /**
      * @test
-     * 
+     *
      * @dataProvider  toBase32PaddedStringProvider
      */
     public function test_toBase32Format_returns_base32_formated_string($str, $expected)

+ 4 - 5
tests/Unit/Listeners/DissociateTwofaccountFromGroupTest.php

@@ -7,8 +7,8 @@ use App\Listeners\DissociateTwofaccountFromGroup;
 use App\Models\Group;
 use App\Models\TwoFAccount;
 use Illuminate\Support\Facades\Event;
-use Tests\TestCase;
 use Mockery\MockInterface;
+use Tests\TestCase;
 
 /**
  * @covers \App\Listeners\DissociateTwofaccountFromGroup
@@ -17,21 +17,20 @@ class DissociateTwofaccountFromGroupTest extends TestCase
 {
     /**
      * @test
-     * 
+     *
      * @runInSeparateProcess
      * @preserveGlobalState disabled
      */
     public function test_twofaccount_is_released_on_group_deletion()
     {
-
         $this->mock('alias:' . TwoFAccount::class, function (MockInterface $twoFAccount) {
             $twoFAccount->shouldReceive('where->update')
                 ->once()
                 ->andReturn(1);
         });
 
-        $group = Group::factory()->make();
-        $event = new GroupDeleting($group);
+        $group    = Group::factory()->make();
+        $event    = new GroupDeleting($group);
         $listener = new DissociateTwofaccountFromGroup();
 
         $this->assertNull($listener->handle($event));

+ 39 - 44
tests/Unit/MigratorTest.php

@@ -3,26 +3,23 @@
 namespace Tests\Unit;
 
 use App\Exceptions\EncryptedMigrationException;
-use App\Factories\MigratorFactory;
 use App\Exceptions\InvalidMigrationDataException;
+use App\Exceptions\UnsupportedMigrationException;
+use App\Factories\MigratorFactory;
 use App\Models\TwoFAccount;
 use App\Services\Migrators\AegisMigrator;
-use App\Services\Migrators\TwoFASMigrator;
+use App\Services\Migrators\GoogleAuthMigrator;
 use App\Services\Migrators\Migrator;
 use App\Services\Migrators\PlainTextMigrator;
-use App\Services\Migrators\GoogleAuthMigrator;
+use App\Services\Migrators\TwoFASMigrator;
 use App\Services\SettingService;
 use Illuminate\Support\Facades\Storage;
 use Mockery;
-use Mockery\Mock;
 use Mockery\MockInterface;
+use ParagonIE\ConstantTime\Base32;
 use Tests\Data\MigrationTestData;
 use Tests\Data\OtpTestData;
 use Tests\TestCase;
-use ParagonIE\ConstantTime\Base32;
-use App\Protobuf\GoogleAuth\Payload\Algorithm;
-use App\Exceptions\UnsupportedMigrationException;
-
 
 /**
  * @covers \App\Providers\MigrationServiceProvider
@@ -32,6 +29,7 @@ use App\Exceptions\UnsupportedMigrationException;
  * @covers \App\Services\Migrators\TwoFASMigrator
  * @covers \App\Services\Migrators\PlainTextMigrator
  * @covers \App\Services\Migrators\GoogleAuthMigrator
+ *
  * @uses \App\Models\TwoFAccount
  */
 class MigratorTest extends TestCase
@@ -61,7 +59,7 @@ class MigratorTest extends TestCase
      */
     protected $GAuthTotpBisTwofaccount;
 
-    public function setUp(): void
+    public function setUp() : void
     {
         parent::setUp();
 
@@ -111,30 +109,30 @@ class MigratorTest extends TestCase
         $this->steamTwofaccount->period     = OtpTestData::PERIOD_DEFAULT;
         $this->steamTwofaccount->counter    = null;
 
-        $this->GAuthTotpTwofaccount             = new TwoFAccount;
-        $this->GAuthTotpTwofaccount->service    = OtpTestData::SERVICE;
-        $this->GAuthTotpTwofaccount->account    = OtpTestData::ACCOUNT;
-        $this->GAuthTotpTwofaccount->icon       = null;
-        $this->GAuthTotpTwofaccount->otp_type   = 'totp';
-        $this->GAuthTotpTwofaccount->secret     = OtpTestData::SECRET;
-        $this->GAuthTotpTwofaccount->digits     = OtpTestData::DIGITS_DEFAULT;
-        $this->GAuthTotpTwofaccount->algorithm  = OtpTestData::ALGORITHM_DEFAULT;
-        $this->GAuthTotpTwofaccount->period     = OtpTestData::PERIOD_DEFAULT;
-        $this->GAuthTotpTwofaccount->counter    = null;
-
-        $this->GAuthTotpBisTwofaccount             = new TwoFAccount;
-        $this->GAuthTotpBisTwofaccount->service    = OtpTestData::SERVICE . '_bis';
-        $this->GAuthTotpBisTwofaccount->account    = OtpTestData::ACCOUNT . '_bis';
-        $this->GAuthTotpBisTwofaccount->icon       = null;
-        $this->GAuthTotpBisTwofaccount->otp_type   = 'totp';
-        $this->GAuthTotpBisTwofaccount->secret     = OtpTestData::SECRET;
-        $this->GAuthTotpBisTwofaccount->digits     = OtpTestData::DIGITS_DEFAULT;
-        $this->GAuthTotpBisTwofaccount->algorithm  = OtpTestData::ALGORITHM_DEFAULT;
-        $this->GAuthTotpBisTwofaccount->period     = OtpTestData::PERIOD_DEFAULT;
-        $this->GAuthTotpBisTwofaccount->counter    = null;
-
-        $this->fakeTwofaccount             = new TwoFAccount;
-        $this->fakeTwofaccount->id         = TwoFAccount::FAKE_ID;
+        $this->GAuthTotpTwofaccount            = new TwoFAccount;
+        $this->GAuthTotpTwofaccount->service   = OtpTestData::SERVICE;
+        $this->GAuthTotpTwofaccount->account   = OtpTestData::ACCOUNT;
+        $this->GAuthTotpTwofaccount->icon      = null;
+        $this->GAuthTotpTwofaccount->otp_type  = 'totp';
+        $this->GAuthTotpTwofaccount->secret    = OtpTestData::SECRET;
+        $this->GAuthTotpTwofaccount->digits    = OtpTestData::DIGITS_DEFAULT;
+        $this->GAuthTotpTwofaccount->algorithm = OtpTestData::ALGORITHM_DEFAULT;
+        $this->GAuthTotpTwofaccount->period    = OtpTestData::PERIOD_DEFAULT;
+        $this->GAuthTotpTwofaccount->counter   = null;
+
+        $this->GAuthTotpBisTwofaccount            = new TwoFAccount;
+        $this->GAuthTotpBisTwofaccount->service   = OtpTestData::SERVICE . '_bis';
+        $this->GAuthTotpBisTwofaccount->account   = OtpTestData::ACCOUNT . '_bis';
+        $this->GAuthTotpBisTwofaccount->icon      = null;
+        $this->GAuthTotpBisTwofaccount->otp_type  = 'totp';
+        $this->GAuthTotpBisTwofaccount->secret    = OtpTestData::SECRET;
+        $this->GAuthTotpBisTwofaccount->digits    = OtpTestData::DIGITS_DEFAULT;
+        $this->GAuthTotpBisTwofaccount->algorithm = OtpTestData::ALGORITHM_DEFAULT;
+        $this->GAuthTotpBisTwofaccount->period    = OtpTestData::PERIOD_DEFAULT;
+        $this->GAuthTotpBisTwofaccount->counter   = null;
+
+        $this->fakeTwofaccount     = new TwoFAccount;
+        $this->fakeTwofaccount->id = TwoFAccount::FAKE_ID;
     }
 
     /**
@@ -179,25 +177,25 @@ class MigratorTest extends TestCase
                 new PlainTextMigrator(),
                 MigrationTestData::VALID_PLAIN_TEXT_PAYLOAD,
                 'custom',
-                $hasSteam = true
+                $hasSteam = true,
             ],
             'PLAIN_TEXT_PAYLOAD_WITH_INTRUDER' => [
                 new PlainTextMigrator(),
                 MigrationTestData::VALID_PLAIN_TEXT_PAYLOAD_WITH_INTRUDER,
                 'custom',
-                $hasSteam = true
+                $hasSteam = true,
             ],
             'AEGIS_JSON_MIGRATION_PAYLOAD' => [
                 new AegisMigrator(),
                 MigrationTestData::VALID_AEGIS_JSON_MIGRATION_PAYLOAD,
                 'custom',
-                $hasSteam = true
+                $hasSteam = true,
             ],
             '2FAS_MIGRATION_PAYLOAD' => [
                 new TwoFASMigrator(),
                 MigrationTestData::VALID_2FAS_MIGRATION_PAYLOAD,
                 'custom',
-                $hasSteam = false
+                $hasSteam = false,
             ],
             'GOOGLE_AUTH_MIGRATION_PAYLOAD' => [
                 new GoogleAuthMigrator(),
@@ -315,7 +313,7 @@ class MigratorTest extends TestCase
 
     /**
      * @test
-     * 
+     *
      * @runInSeparateProcess
      * @preserveGlobalState disabled
      */
@@ -466,18 +464,15 @@ class MigratorTest extends TestCase
     {
         return [
             'ENCRYPTED_AEGIS_JSON_MIGRATION_PAYLOAD' => [
-                MigrationTestData::ENCRYPTED_AEGIS_JSON_MIGRATION_PAYLOAD
+                MigrationTestData::ENCRYPTED_AEGIS_JSON_MIGRATION_PAYLOAD,
             ],
             'ENCRYPTED_2FAS_MIGRATION_PAYLOAD' => [
-                MigrationTestData::ENCRYPTED_2FAS_MIGRATION_PAYLOAD
+                MigrationTestData::ENCRYPTED_2FAS_MIGRATION_PAYLOAD,
             ],
         ];
     }
 
-    /**
-     * 
-     */
-    protected function tearDown(): void
+    protected function tearDown() : void
     {
         Mockery::close();
     }

+ 2 - 2
tests/Unit/TwoFAccountModelTest.php

@@ -59,7 +59,7 @@ class TwoFAccountModelTest extends ModelTestCase
     /**
      * Provide attributes to test for encryption
      */
-    public function provideSensitiveAttributes(): array
+    public function provideSensitiveAttributes() : array
     {
         return [
             [
@@ -115,7 +115,7 @@ class TwoFAccountModelTest extends ModelTestCase
 
     /**
      * @test
-     * 
+     *
      * @runInSeparateProcess
      * @preserveGlobalState disabled
      */