Fix pint issues

This commit is contained in:
Bubka 2024-05-29 11:53:41 +02:00
parent 7e52dcd7da
commit bc090e2d4d
6 changed files with 20 additions and 22 deletions

View File

@ -12,10 +12,10 @@ class CaseInsensitiveEmailExists implements ValidationRule
/** /**
* Run the validation rule. * Run the validation rule.
*/ */
public function validate(string $attribute, mixed $value, Closure $fail): void public function validate(string $attribute, mixed $value, Closure $fail) : void
{ {
$user = DB::table('users') $user = DB::table('users')
->whereRaw('email = ?' . ('sqlite' === config('database.default') ? ' COLLATE NOCASE' : ''), [strtolower($value)]) ->whereRaw('email = ?' . (config('database.default') === 'sqlite' ? ' COLLATE NOCASE' : ''), [strtolower($value)])
->first(); ->first();
if (! $user) { if (! $user) {

View File

@ -77,7 +77,8 @@ class GoogleAuthMigrator extends Migrator
/** /**
* Encode into uppercase Base32 * Encode into uppercase Base32
*/ */
protected function toBase32(string $str) { protected function toBase32(string $str)
{
return Base32::encodeUpper($str); return Base32::encodeUpper($str);
} }
} }

View File

@ -45,10 +45,10 @@ class PurgeLogTest extends FeatureTestCase
$this->artisan('2fauth:purge-log'); $this->artisan('2fauth:purge-log');
$this->assertDatabaseHas('auth_logs', [ $this->assertDatabaseHas('auth_logs', [
'id' => $sixMonthsOldLog->id 'id' => $sixMonthsOldLog->id,
]); ]);
$this->assertDatabaseMissing('auth_logs', [ $this->assertDatabaseMissing('auth_logs', [
'id' => $oneYearOldLog->id 'id' => $oneYearOldLog->id,
]); ]);
} }
@ -64,7 +64,7 @@ class PurgeLogTest extends FeatureTestCase
$this->artisan('2fauth:purge-log'); $this->artisan('2fauth:purge-log');
$this->assertDatabaseMissing('auth_logs', [ $this->assertDatabaseMissing('auth_logs', [
'id' => $log->id 'id' => $log->id,
]); ]);
} }
@ -81,7 +81,7 @@ class PurgeLogTest extends FeatureTestCase
$this->artisan('2fauth:purge-log'); $this->artisan('2fauth:purge-log');
$this->assertDatabaseMissing('auth_logs', [ $this->assertDatabaseMissing('auth_logs', [
'id' => $log->id 'id' => $log->id,
]); ]);
} }
@ -97,7 +97,7 @@ class PurgeLogTest extends FeatureTestCase
$this->artisan('2fauth:purge-log'); $this->artisan('2fauth:purge-log');
$this->assertDatabaseHas('auth_logs', [ $this->assertDatabaseHas('auth_logs', [
'id' => $log->id 'id' => $log->id,
]); ]);
} }
@ -114,10 +114,10 @@ class PurgeLogTest extends FeatureTestCase
$this->artisan('2fauth:purge-log'); $this->artisan('2fauth:purge-log');
$this->assertDatabaseHas('auth_logs', [ $this->assertDatabaseHas('auth_logs', [
'id' => $sixMonthsOldLog->id 'id' => $sixMonthsOldLog->id,
]); ]);
$this->assertDatabaseMissing('auth_logs', [ $this->assertDatabaseMissing('auth_logs', [
'id' => $oneYearOldLog->id 'id' => $oneYearOldLog->id,
]); ]);
} }
@ -128,15 +128,14 @@ class PurgeLogTest extends FeatureTestCase
{ {
return [ return [
'NULL' => [ 'NULL' => [
null null,
], ],
'EMPTY' => [ 'EMPTY' => [
'' '',
], ],
'STRING' => [ 'STRING' => [
'ljhkjh' 'ljhkjh',
], ],
]; ];
} }
} }

View File

@ -16,7 +16,6 @@ use App\Services\Migrators\TwoFASMigrator;
use App\Services\Migrators\TwoFAuthMigrator; use App\Services\Migrators\TwoFAuthMigrator;
use App\Services\SettingService; use App\Services\SettingService;
use Illuminate\Support\Facades\Storage; use Illuminate\Support\Facades\Storage;
use Mockery;
use Mockery\MockInterface; use Mockery\MockInterface;
use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\DataProvider;
@ -141,7 +140,6 @@ class MigratorTest extends TestCase
/** /**
* Clean up the testing environment before the next test. * Clean up the testing environment before the next test.
* *
* @return void
* *
* @throws \Mockery\Exception\InvalidCountException * @throws \Mockery\Exception\InvalidCountException
*/ */