Skip to content

Commit

Permalink
Merge branch 'main' of github.com:stefanzweifel/laravel-backup-restore
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanzweifel committed Aug 7, 2024
2 parents 1b53f88 + 259fcb4 commit 5d671a5
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 18 deletions.
8 changes: 4 additions & 4 deletions src/DbImporterFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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),
};
}
Expand Down
4 changes: 1 addition & 3 deletions src/Events/DatabaseDumpImportWasSuccessful.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@

class DatabaseDumpImportWasSuccessful
{
public function __construct(readonly public string $absolutePathToDump)
{
}
public function __construct(readonly public string $absolutePathToDump) {}
}
4 changes: 1 addition & 3 deletions src/Events/DatabaseReset.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,5 @@

class DatabaseReset
{
public function __construct(readonly public PendingRestore $pendingRestore)
{
}
public function __construct(readonly public PendingRestore $pendingRestore) {}
}
4 changes: 1 addition & 3 deletions src/Events/DatabaseRestored.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,5 @@

class DatabaseRestored
{
public function __construct(readonly public PendingRestore $pendingRestore)
{
}
public function __construct(readonly public PendingRestore $pendingRestore) {}
}
2 changes: 1 addition & 1 deletion tests/Actions/CheckDependenciesActionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion tests/DbImporterFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
6 changes: 3 additions & 3 deletions tests/HealthChecks/ResultTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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::');
Expand All @@ -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::');
Expand Down

0 comments on commit 5d671a5

Please sign in to comment.