From 62f7ad85060b12370977efae591d5cb773657cf3 Mon Sep 17 00:00:00 2001 From: "Jonathan H. Wage" Date: Wed, 17 Apr 2019 08:47:09 -0500 Subject: [PATCH] Drop support for feferred misspelling in PostgreSqlPlatform::getAdvancedForeignKeyOptionsSQL() --- UPGRADE.md | 5 +++++ lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php | 4 +--- .../DBAL/Platforms/AbstractPostgreSqlPlatformTestCase.php | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/UPGRADE.md b/UPGRADE.md index 9a0c03d24d3..423decff5cb 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -1,5 +1,10 @@ # Upgrade to 3.0 +## BC BREAK PostgreSqlPlatform ForeignKeyConstraint support for `feferred` misspelling removed + +`PostgreSqlPlatform::getAdvancedForeignKeyOptionsSQL()` had a typo in it in 2.x. Both the option name +`feferred` and `deferred` were supported in `2.x` but the misspelling was removed in 3.x. + ## BC BREAK `AbstractSchemaManager::extractDoctrineTypeFromComment()` changed, `::removeDoctrineTypeFromComment()` removed `AbstractSchemaManager::extractDoctrineTypeFromComment()` made `protected`. It takes the comment by reference, removes the type annotation from it and returns the extracted Doctrine type. diff --git a/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php b/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php index 4fa61fbdeca..b2601286ff7 100644 --- a/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php +++ b/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php @@ -466,9 +466,7 @@ public function getAdvancedForeignKeyOptionsSQL(ForeignKeyConstraint $foreignKey $query .= ' NOT DEFERRABLE'; } - if (($foreignKey->hasOption('feferred') && $foreignKey->getOption('feferred') !== false) - || ($foreignKey->hasOption('deferred') && $foreignKey->getOption('deferred') !== false) - ) { + if ($foreignKey->hasOption('deferred') && $foreignKey->getOption('deferred') !== false) { $query .= ' INITIALLY DEFERRED'; } else { $query .= ' INITIALLY IMMEDIATE'; diff --git a/tests/Doctrine/Tests/DBAL/Platforms/AbstractPostgreSqlPlatformTestCase.php b/tests/Doctrine/Tests/DBAL/Platforms/AbstractPostgreSqlPlatformTestCase.php index ed31a21fffc..b4bfa055f23 100644 --- a/tests/Doctrine/Tests/DBAL/Platforms/AbstractPostgreSqlPlatformTestCase.php +++ b/tests/Doctrine/Tests/DBAL/Platforms/AbstractPostgreSqlPlatformTestCase.php @@ -111,7 +111,7 @@ public function testGeneratesForeignKeySqlForNonStandardOptions() 'my_table', ['id'], 'my_fk', - ['feferred' => true] + ['deferred' => true] ); self::assertEquals( 'CONSTRAINT my_fk FOREIGN KEY (foreign_id) REFERENCES my_table (id) NOT DEFERRABLE INITIALLY DEFERRED',