Skip to content

Commit

Permalink
Drop DBAL 2 compat code (doctrine#11674)
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabus authored Oct 13, 2024
1 parent 737aee7 commit e9f3ca2
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions tests/Tests/ORM/Functional/Ticket/GH10747Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
use Doctrine\Tests\OrmFunctionalTestCase;
use PHPUnit\Framework\Attributes\Group;

use function method_exists;
use function str_replace;

/**
Expand Down Expand Up @@ -135,23 +134,19 @@ public function __construct(GH10747Article $article, public string $name)

class GH10747CustomIdObjectHashType extends DBALType
{
public function convertToDatabaseValue(mixed $value, AbstractPlatform $platform): mixed
public function convertToDatabaseValue(mixed $value, AbstractPlatform $platform): string
{
return $value->id . '_test';
}

public function convertToPHPValue(mixed $value, AbstractPlatform $platform): mixed
public function convertToPHPValue(mixed $value, AbstractPlatform $platform): CustomIdObject
{
return new CustomIdObject(str_replace('_test', '', $value));
}

public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform): string
public function getSQLDeclaration(array $column, AbstractPlatform $platform): string
{
if (method_exists($platform, 'getStringTypeDeclarationSQL')) {
return $platform->getStringTypeDeclarationSQL($fieldDeclaration);
}

return $platform->getVarcharTypeDeclarationSQL($fieldDeclaration);
return $platform->getStringTypeDeclarationSQL($column);
}

public function getName(): string
Expand Down

0 comments on commit e9f3ca2

Please sign in to comment.