Skip to content

Commit

Permalink
Merge pull request #5136 from morozov/deprecate-can-require-sql-conve…
Browse files Browse the repository at this point in the history
…rsion

Deprecate Type::canRequireSQLConversion()
  • Loading branch information
morozov authored Dec 20, 2021
2 parents 421b8e8 + fe4e6f4 commit fffcfbc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ awareness about deprecated code.

# Upgrade to 3.3

## Deprecated `Type::canRequireSQLConversion()`.

Consumers should call `Type::convertToDatabaseValueSQL()` and `Type::convertToPHPValueSQL()` regardless of the type.

## Deprecated the `doctrine-dbal` binary.

The documentation explains how the console tools can be bootstrapped for standalone usage.
Expand Down
5 changes: 5 additions & 0 deletions psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,11 @@
<referencedMethod name="Doctrine\DBAL\Platforms\DB2Platform::prefersIdentityColumns"/>
<referencedMethod name="Doctrine\DBAL\Platforms\SQLServerPlatform::prefersIdentityColumns"/>
<referencedMethod name="Doctrine\DBAL\Platforms\SqlitePlatform::prefersIdentityColumns"/>
<!--
TODO: remove in 4.0.0
See https://github.com/doctrine/dbal/pull/5136
-->
<referencedMethod name="Doctrine\DBAL\Types\Type::canRequireSQLConversion"/>
</errorLevel>
</DeprecatedMethod>
<DeprecatedProperty>
Expand Down
3 changes: 3 additions & 0 deletions src/Types/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,9 @@ static function (Type $type): string {
* {@see convertToPHPValueSQL} works for any type and mostly
* does nothing. This method can additionally be used for optimization purposes.
*
* @deprecated Consumers should call {@see convertToDatabaseValueSQL} and {@see convertToPHPValueSQL}
* regardless of the type.
*
* @return bool
*/
public function canRequireSQLConversion()
Expand Down

0 comments on commit fffcfbc

Please sign in to comment.