Skip to content

Commit 99d0cf3

Browse files
Merge pull request #17 from dpws-systems/main
Support subclasses of `Illuminate\Database\Schema\*Connection`
2 parents e1e1d1a + dfb1483 commit 99d0cf3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Service/Dumper.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ protected function export(Connection $connection, string $path, string $table):
3737

3838
protected function schemaState(Connection $connection): ?SchemaState
3939
{
40-
return match (get_class($connection)) {
41-
SQLiteConnection::class => new SQLiteSchemaState($connection, null, null),
42-
MySqlConnection::class => new MySqlSchemaState($connection, null, null),
43-
PostgresConnection::class => new PostgresSchemaState($connection, null, null),
40+
return match (true) {
41+
$connection instanceof SQLiteConnection => new SQLiteSchemaState($connection, null, null),
42+
$connection instanceof MySqlConnection => new MySqlSchemaState($connection, null, null),
43+
$connection instanceof PostgresConnection => new PostgresSchemaState($connection, null, null),
4444
default => null
4545
};
4646
}

0 commit comments

Comments
 (0)