From eb34f488d3e02dda59861fe7c13e2edd650eda1c Mon Sep 17 00:00:00 2001 From: Sergei Morozov Date: Mon, 19 Oct 2020 21:13:22 -0700 Subject: [PATCH] Move the logic out of the assertion --- lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php b/lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php index e64a9c81735..4d7f3d7f953 100644 --- a/lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php @@ -154,11 +154,8 @@ protected function _getPortableTableForeignKeyDefinition($tableForeignKey) $onDelete = $match[1]; } - assert(preg_match( - '/FOREIGN KEY \((.+)\) REFERENCES (.+)\((.+)\)/', - $tableForeignKey['condef'], - $values - ) !== 0); + $result = preg_match('/FOREIGN KEY \((.+)\) REFERENCES (.+)\((.+)\)/', $tableForeignKey['condef'], $values); + assert($result === 1); // PostgreSQL returns identifiers that are keywords with quotes, we need them later, don't get // the idea to trim them here.