Skip to content

Commit

Permalink
Merge pull request #5143 from morozov/remove-can-require-sql-conversion
Browse files Browse the repository at this point in the history
Remove Type::canRequireSQLConversion()
  • Loading branch information
morozov authored Dec 24, 2021
2 parents 3d50257 + 8d50640 commit ffe985e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 22 deletions.
4 changes: 4 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ following methods are removed:
The protected property `AbstractPlatform::$doctrineTypeComments` is removed as
well.

## BC BREAK: Removed `Type::canRequireSQLConversion()`

The `Type::canRequireSQLConversion()` method has been removed.

## BC BREAK: Removed `Connection::getWrappedConnection()`, `Connection::connect()` made `protected`.

The wrapper-level `Connection::getWrappedConnection()` method has been removed. The `Connection::connect()` method
Expand Down
5 changes: 0 additions & 5 deletions psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@
See https://github.com/doctrine/dbal/pull/4317
-->
<file name="tests/Functional/LegacyAPITest.php"/>
<!--
TODO: remove in 4.0.0
See https://github.com/doctrine/dbal/pull/5136
-->
<referencedMethod name="Doctrine\DBAL\Types\Type::canRequireSQLConversion"/>
</errorLevel>
</DeprecatedMethod>
<DocblockTypeContradiction>
Expand Down
16 changes: 0 additions & 16 deletions src/Types/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,22 +203,6 @@ static function (Type $type): string {
);
}

/**
* Does working with this column require SQL conversion functions?
*
* This is a metadata function that is required for example in the ORM.
* Usage of {@see convertToDatabaseValueSQL} and
* {@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.
*/
public function canRequireSQLConversion(): bool
{
return false;
}

/**
* Modifies the SQL expression (identifier, parameter) to convert to a database value.
*/
Expand Down
1 change: 0 additions & 1 deletion tests/Types/StringTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public function testNullConversion(): void

public function testSQLConversion(): void
{
self::assertFalse($this->type->canRequireSQLConversion());
self::assertEquals('t.foo', $this->type->convertToDatabaseValueSQL('t.foo', $this->platform));
self::assertEquals('t.foo', $this->type->convertToPHPValueSQL('t.foo', $this->platform));
}
Expand Down

0 comments on commit ffe985e

Please sign in to comment.