Skip to content

Remove Type::canRequireSQLConversion() #5143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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