Skip to content

Commit

Permalink
Merge pull request doctrine#4364 from morozov/issues/4359
Browse files Browse the repository at this point in the history
Move the logic out of the assertion
  • Loading branch information
morozov authored Oct 20, 2020
2 parents 1f72f05 + eb34f48 commit bc61ebe
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit bc61ebe

Please sign in to comment.