From 259fcb4072f06ff3d55cc401e519129532bd64e4 Mon Sep 17 00:00:00 2001 From: stefanzweifel Date: Wed, 7 Aug 2024 17:07:09 +0000 Subject: [PATCH] Apply laravel-pint changes --- src/DbImporterFactory.php | 8 ++++---- src/Events/DatabaseDumpImportWasSuccessful.php | 4 +--- src/Events/DatabaseReset.php | 4 +--- src/Events/DatabaseRestored.php | 4 +--- tests/Actions/CheckDependenciesActionTest.php | 2 +- tests/DbImporterFactoryTest.php | 2 +- tests/HealthChecks/ResultTest.php | 6 +++--- 7 files changed, 12 insertions(+), 18 deletions(-) diff --git a/src/DbImporterFactory.php b/src/DbImporterFactory.php index a3a3ce9..60d1599 100644 --- a/src/DbImporterFactory.php +++ b/src/DbImporterFactory.php @@ -42,13 +42,13 @@ protected static function forDriver(string $driver): DbImporter $driver = Str::lower($driver); if (isset(static::$custom[$driver])) { - return new static::$custom[$driver](); + return new static::$custom[$driver]; } return match ($driver) { - 'mysql' => new MySql(), - 'pgsql' => new PostgreSql(), - 'sqlite' => new Sqlite(), + 'mysql' => new MySql, + 'pgsql' => new PostgreSql, + 'sqlite' => new Sqlite, default => throw CannotCreateDbImporter::unsupportedDriver($driver), }; } diff --git a/src/Events/DatabaseDumpImportWasSuccessful.php b/src/Events/DatabaseDumpImportWasSuccessful.php index 9d6b88d..3563e1a 100644 --- a/src/Events/DatabaseDumpImportWasSuccessful.php +++ b/src/Events/DatabaseDumpImportWasSuccessful.php @@ -6,7 +6,5 @@ class DatabaseDumpImportWasSuccessful { - public function __construct(readonly public string $absolutePathToDump) - { - } + public function __construct(readonly public string $absolutePathToDump) {} } diff --git a/src/Events/DatabaseReset.php b/src/Events/DatabaseReset.php index 4e9a720..7cbb98e 100644 --- a/src/Events/DatabaseReset.php +++ b/src/Events/DatabaseReset.php @@ -8,7 +8,5 @@ class DatabaseReset { - public function __construct(readonly public PendingRestore $pendingRestore) - { - } + public function __construct(readonly public PendingRestore $pendingRestore) {} } diff --git a/src/Events/DatabaseRestored.php b/src/Events/DatabaseRestored.php index f818502..20ad71d 100644 --- a/src/Events/DatabaseRestored.php +++ b/src/Events/DatabaseRestored.php @@ -8,7 +8,5 @@ class DatabaseRestored { - public function __construct(readonly public PendingRestore $pendingRestore) - { - } + public function __construct(readonly public PendingRestore $pendingRestore) {} } diff --git a/tests/Actions/CheckDependenciesActionTest.php b/tests/Actions/CheckDependenciesActionTest.php index 8c7d518..07d0293 100644 --- a/tests/Actions/CheckDependenciesActionTest.php +++ b/tests/Actions/CheckDependenciesActionTest.php @@ -13,7 +13,7 @@ })->with(['mysql', 'pgsql', 'sqlite']); it('throws exception if CLI dependency for given connection can not be found', function () { - DbImporterFactory::extend('sqlsrv', new class() extends DbImporter + DbImporterFactory::extend('sqlsrv', new class extends DbImporter { public function getImportCommand(string $dumpFile, string $connection): string { diff --git a/tests/DbImporterFactoryTest.php b/tests/DbImporterFactoryTest.php index 0724c23..a235518 100644 --- a/tests/DbImporterFactoryTest.php +++ b/tests/DbImporterFactoryTest.php @@ -36,7 +36,7 @@ ]); it('returns custom db importer instance for the given database driver', function () { - DbImporterFactory::extend('sqlsrv', new class() extends DbImporter + DbImporterFactory::extend('sqlsrv', new class extends DbImporter { public function getImportCommand(string $dumpFile, string $connection): string { diff --git a/tests/HealthChecks/ResultTest.php b/tests/HealthChecks/ResultTest.php index 3ffe663..fa6dc64 100644 --- a/tests/HealthChecks/ResultTest.php +++ b/tests/HealthChecks/ResultTest.php @@ -7,7 +7,7 @@ use Wnx\LaravelBackupRestore\HealthChecks\Result; it('returns ok result by default', function () { - $check = new DatabaseHasTables(); + $check = new DatabaseHasTables; $result = Result::make($check); expect($result) @@ -18,7 +18,7 @@ }); it('returns failed result when using failed method', function () { - $check = new DatabaseHasTables(); + $check = new DatabaseHasTables; $result = Result::make($check); $result->failed('::message::'); @@ -31,7 +31,7 @@ }); test('returns ok result when using ok method', function () { - $check = new DatabaseHasTables(); + $check = new DatabaseHasTables; $result = Result::make($check); $result->failed('::message::');