Skip to content

Commit 7add517

Browse files
committed
fix comparator typehints for compatibility
1 parent 1f2373b commit 7add517

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/DBAL/Schema/Comparator.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,19 @@
55
namespace Pfilsx\PostgreSQLDoctrine\DBAL\Schema;
66

77
use Doctrine\DBAL\Schema\Comparator as BaseComparator;
8+
use Doctrine\DBAL\Schema\Schema as BaseSchema;
9+
use Doctrine\DBAL\Schema\SchemaDiff as BaseSchemaDiff;
810

911
final class Comparator extends BaseComparator
1012
{
11-
public function compareSchemas(Schema $fromSchema, Schema $toSchema): SchemaDiff
13+
public function compareSchemas(BaseSchema $fromSchema, BaseSchema $toSchema): BaseSchemaDiff
1214
{
1315
$baseDiff = parent::compareSchemas($fromSchema, $toSchema);
1416

17+
if (!$fromSchema instanceof Schema || !$toSchema instanceof Schema) {
18+
return $baseDiff;
19+
}
20+
1521
$createdTypes = [];
1622
$alteredTypes = [];
1723
$droppedTypes = [];

0 commit comments

Comments
 (0)