From 0ce37cf4572b31efb2912d53f9c7379d22d449e0 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 20 Oct 2020 17:19:13 +0200 Subject: [PATCH] Fix undefined variable when assert() is disabled --- lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php b/lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php index e64a9c81735..79a184c6a17 100644 --- a/lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php @@ -154,11 +154,12 @@ protected function _getPortableTableForeignKeyDefinition($tableForeignKey) $onDelete = $match[1]; } - assert(preg_match( + $match = preg_match( '/FOREIGN KEY \((.+)\) REFERENCES (.+)\((.+)\)/', $tableForeignKey['condef'], $values - ) !== 0); + ); + assert($match !== 0); // PostgreSQL returns identifiers that are keywords with quotes, we need them later, don't get // the idea to trim them here.