Skip to content

Commit

Permalink
Deprecate AbstractPlatform::supportsForeignKeyConstraints()
Browse files Browse the repository at this point in the history
  • Loading branch information
morozov committed May 22, 2022
1 parent 7df5dd5 commit 9b5215a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ awareness about deprecated code.

# Upgrade to 3.4

## Deprecated `AbstractPlatform::supportsForeignKeyConstraints()`.

The `AbstractPlatform::supportsForeignKeyConstraints()` method has been deprecated. All platforms should support
foreign key constraints.

## Deprecated `AbstractPlatform` methods exposing quote characters.

The `AbstractPlatform::getStringLiteralQuoteCharacter()` and `::getIdentifierQuoteCharacter()` methods
Expand Down
4 changes: 4 additions & 0 deletions psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,10 @@
<referencedMethod name="Doctrine\DBAL\Platforms\AbstractMySQLPlatform::getIdentifierQuoteCharacter"/>
<referencedMethod name="Doctrine\DBAL\Platforms\AbstractPlatform::getIdentifierQuoteCharacter"/>
<referencedMethod name="Doctrine\DBAL\Platforms\AbstractPlatform::getStringLiteralQuoteCharacter"/>
<!--
TODO: remove in 4.0.0
-->
<referencedMethod name="Doctrine\DBAL\Platforms\AbstractPlatform::supportsForeignKeyConstraints"/>
</errorLevel>
</DeprecatedMethod>
<DeprecatedProperty>
Expand Down
8 changes: 8 additions & 0 deletions src/Platforms/AbstractPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -3708,10 +3708,18 @@ public function supportsPrimaryConstraints()
/**
* Whether the platform supports foreign key constraints.
*
* @deprecated All platforms should support foreign key constraints.
*
* @return bool
*/
public function supportsForeignKeyConstraints()
{
Deprecation::triggerIfCalledFromOutside(
'doctrine/dbal',
'https://github.com/doctrine/dbal/pulls/5409',
'AbstractPlatform::supportsForeignKeyConstraints() is deprecated.'
);

return true;
}

Expand Down

0 comments on commit 9b5215a

Please sign in to comment.