From 1358700adb7247dde9fbebfa35536deafa7c4bef Mon Sep 17 00:00:00 2001 From: Sergei Morozov Date: Fri, 15 Jul 2022 17:12:59 -0700 Subject: [PATCH 1/2] Remove Type::requiresSQLCommentHint() --- UPGRADE.md | 5 ++--- psalm.xml.dist | 12 ----------- src/Types/BooleanType.php | 19 ------------------ src/Types/DateImmutableType.php | 16 --------------- src/Types/DateIntervalType.php | 16 --------------- src/Types/DateTimeImmutableType.php | 16 --------------- src/Types/DateTimeTzImmutableType.php | 16 --------------- src/Types/GuidType.php | 16 --------------- src/Types/JsonType.php | 16 --------------- src/Types/SimpleArrayType.php | 16 --------------- src/Types/TimeImmutableType.php | 16 --------------- src/Types/Type.php | 21 -------------------- src/Types/VarDateTimeImmutableType.php | 16 --------------- tests/Types/DateImmutableTypeTest.php | 5 ----- tests/Types/DateIntervalTest.php | 5 ----- tests/Types/DateTimeImmutableTypeTest.php | 5 ----- tests/Types/DateTimeTzImmutableTypeTest.php | 5 ----- tests/Types/GuidTypeTest.php | 11 ---------- tests/Types/JsonTest.php | 5 ----- tests/Types/TimeImmutableTypeTest.php | 5 ----- tests/Types/VarDateTimeImmutableTypeTest.php | 5 ----- 21 files changed, 2 insertions(+), 245 deletions(-) diff --git a/UPGRADE.md b/UPGRADE.md index 635fdb5e763..a120b08e927 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -209,13 +209,12 @@ Postgres 9 is not actively supported anymore. The following classes have been me ## BC BREAK: Removed Platform "commented type" API -Since `Type::requiresSQLCommentTypeHint()` already allows determining whether a -type should result in SQL columns with a type hint in their comments, the -following methods are removed: +The following methods are removed: - `AbstractPlatform::isCommentedDoctrineType()` - `AbstractPlatform::initializeCommentedDoctrineTypes()` - `AbstractPlatform::markDoctrineTypeCommented()` +- `Type::requiresSQLCommentHint()` The protected property `AbstractPlatform::$doctrineTypeComments` is removed as well. diff --git a/psalm.xml.dist b/psalm.xml.dist index d824217b434..d03bd247af1 100644 --- a/psalm.xml.dist +++ b/psalm.xml.dist @@ -42,18 +42,6 @@ - - - - - - - - - - diff --git a/src/Types/BooleanType.php b/src/Types/BooleanType.php index 5ca7af5ed81..8dc2cf22a3a 100644 --- a/src/Types/BooleanType.php +++ b/src/Types/BooleanType.php @@ -6,8 +6,6 @@ use Doctrine\DBAL\ParameterType; use Doctrine\DBAL\Platforms\AbstractPlatform; -use Doctrine\DBAL\Platforms\DB2Platform; -use Doctrine\Deprecations\Deprecation; /** * Type that maps an SQL boolean to a PHP boolean. @@ -36,21 +34,4 @@ public function getBindingType(): int { return ParameterType::BOOLEAN; } - - /** - * @deprecated - */ - public function requiresSQLCommentHint(AbstractPlatform $platform): bool - { - Deprecation::triggerIfCalledFromOutside( - 'doctrine/dbal', - 'https://github.com/doctrine/dbal/pull/5509', - '%s is deprecated.', - __METHOD__ - ); - - // We require a commented boolean type in order to distinguish between - // boolean and smallint as both (have to) map to the same native type. - return $platform instanceof DB2Platform; - } } diff --git a/src/Types/DateImmutableType.php b/src/Types/DateImmutableType.php index 1aeecc45086..26664a2cedb 100644 --- a/src/Types/DateImmutableType.php +++ b/src/Types/DateImmutableType.php @@ -8,7 +8,6 @@ use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Types\Exception\InvalidFormat; use Doctrine\DBAL\Types\Exception\InvalidType; -use Doctrine\Deprecations\Deprecation; /** * Immutable type of {@see DateType}. @@ -50,19 +49,4 @@ public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?Da return $dateTime; } - - /** - * @deprecated - */ - public function requiresSQLCommentHint(AbstractPlatform $platform): bool - { - Deprecation::triggerIfCalledFromOutside( - 'doctrine/dbal', - 'https://github.com/doctrine/dbal/pull/5509', - '%s is deprecated.', - __METHOD__ - ); - - return true; - } } diff --git a/src/Types/DateIntervalType.php b/src/Types/DateIntervalType.php index e82e63bee6e..9d3d6e3ee2f 100644 --- a/src/Types/DateIntervalType.php +++ b/src/Types/DateIntervalType.php @@ -8,7 +8,6 @@ use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Types\Exception\InvalidFormat; use Doctrine\DBAL\Types\Exception\InvalidType; -use Doctrine\Deprecations\Deprecation; use Throwable; use function substr; @@ -68,19 +67,4 @@ public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?Da throw InvalidFormat::new($value, static::class, self::FORMAT, $exception); } } - - /** - * @deprecated - */ - public function requiresSQLCommentHint(AbstractPlatform $platform): bool - { - Deprecation::triggerIfCalledFromOutside( - 'doctrine/dbal', - 'https://github.com/doctrine/dbal/pull/5509', - '%s is deprecated.', - __METHOD__ - ); - - return true; - } } diff --git a/src/Types/DateTimeImmutableType.php b/src/Types/DateTimeImmutableType.php index e4990de810d..dce154e7ef8 100644 --- a/src/Types/DateTimeImmutableType.php +++ b/src/Types/DateTimeImmutableType.php @@ -8,7 +8,6 @@ use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Types\Exception\InvalidFormat; use Doctrine\DBAL\Types\Exception\InvalidType; -use Doctrine\Deprecations\Deprecation; use function date_create_immutable; @@ -56,19 +55,4 @@ public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?Da return $dateTime; } - - /** - * @deprecated - */ - public function requiresSQLCommentHint(AbstractPlatform $platform): bool - { - Deprecation::triggerIfCalledFromOutside( - 'doctrine/dbal', - 'https://github.com/doctrine/dbal/pull/5509', - '%s is deprecated.', - __METHOD__ - ); - - return true; - } } diff --git a/src/Types/DateTimeTzImmutableType.php b/src/Types/DateTimeTzImmutableType.php index 28daf36a81d..c9dac14448f 100644 --- a/src/Types/DateTimeTzImmutableType.php +++ b/src/Types/DateTimeTzImmutableType.php @@ -8,7 +8,6 @@ use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Types\Exception\InvalidFormat; use Doctrine\DBAL\Types\Exception\InvalidType; -use Doctrine\Deprecations\Deprecation; /** * Immutable type of {@see DateTimeTzType}. @@ -50,19 +49,4 @@ public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?Da return $dateTime; } - - /** - * @deprecated - */ - public function requiresSQLCommentHint(AbstractPlatform $platform): bool - { - Deprecation::triggerIfCalledFromOutside( - 'doctrine/dbal', - 'https://github.com/doctrine/dbal/pull/5509', - '%s is deprecated.', - __METHOD__ - ); - - return true; - } } diff --git a/src/Types/GuidType.php b/src/Types/GuidType.php index 17b3cd99748..642e061b54b 100644 --- a/src/Types/GuidType.php +++ b/src/Types/GuidType.php @@ -5,7 +5,6 @@ namespace Doctrine\DBAL\Types; use Doctrine\DBAL\Platforms\AbstractPlatform; -use Doctrine\Deprecations\Deprecation; /** * Represents a GUID/UUID datatype (both are actually synonyms) in the database. @@ -19,19 +18,4 @@ public function getSQLDeclaration(array $column, AbstractPlatform $platform): st { return $platform->getGuidTypeDeclarationSQL($column); } - - /** - * @deprecated - */ - public function requiresSQLCommentHint(AbstractPlatform $platform): bool - { - Deprecation::triggerIfCalledFromOutside( - 'doctrine/dbal', - 'https://github.com/doctrine/dbal/pull/5509', - '%s is deprecated.', - __METHOD__ - ); - - return ! $platform->hasNativeGuidType(); - } } diff --git a/src/Types/JsonType.php b/src/Types/JsonType.php index c975eff13d5..0c63ec96395 100644 --- a/src/Types/JsonType.php +++ b/src/Types/JsonType.php @@ -7,7 +7,6 @@ use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Types\Exception\SerializationFailed; use Doctrine\DBAL\Types\Exception\ValueNotConvertible; -use Doctrine\Deprecations\Deprecation; use JsonException; use function is_resource; @@ -60,19 +59,4 @@ public function convertToPHPValue(mixed $value, AbstractPlatform $platform): mix throw ValueNotConvertible::new($value, 'json', $e->getMessage(), $e); } } - - /** - * @deprecated - */ - public function requiresSQLCommentHint(AbstractPlatform $platform): bool - { - Deprecation::triggerIfCalledFromOutside( - 'doctrine/dbal', - 'https://github.com/doctrine/dbal/pull/5509', - '%s is deprecated.', - __METHOD__ - ); - - return ! $platform->hasNativeJsonType(); - } } diff --git a/src/Types/SimpleArrayType.php b/src/Types/SimpleArrayType.php index 0737ffcf2ee..98dcf046f2e 100644 --- a/src/Types/SimpleArrayType.php +++ b/src/Types/SimpleArrayType.php @@ -5,7 +5,6 @@ namespace Doctrine\DBAL\Types; use Doctrine\DBAL\Platforms\AbstractPlatform; -use Doctrine\Deprecations\Deprecation; use function count; use function explode; @@ -51,19 +50,4 @@ public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?ar return explode(',', $value); } - - /** - * @deprecated - */ - public function requiresSQLCommentHint(AbstractPlatform $platform): bool - { - Deprecation::triggerIfCalledFromOutside( - 'doctrine/dbal', - 'https://github.com/doctrine/dbal/pull/5509', - '%s is deprecated.', - __METHOD__ - ); - - return true; - } } diff --git a/src/Types/TimeImmutableType.php b/src/Types/TimeImmutableType.php index adf181a9179..cb620d029ab 100644 --- a/src/Types/TimeImmutableType.php +++ b/src/Types/TimeImmutableType.php @@ -8,7 +8,6 @@ use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Types\Exception\InvalidFormat; use Doctrine\DBAL\Types\Exception\InvalidType; -use Doctrine\Deprecations\Deprecation; /** * Immutable type of {@see TimeType}. @@ -50,19 +49,4 @@ public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?Da return $dateTime; } - - /** - * @deprecated - */ - public function requiresSQLCommentHint(AbstractPlatform $platform): bool - { - Deprecation::triggerIfCalledFromOutside( - 'doctrine/dbal', - 'https://github.com/doctrine/dbal/pull/5509', - '%s is deprecated.', - __METHOD__ - ); - - return true; - } } diff --git a/src/Types/Type.php b/src/Types/Type.php index 940a7e61d4b..325f25a3092 100644 --- a/src/Types/Type.php +++ b/src/Types/Type.php @@ -7,7 +7,6 @@ use Doctrine\DBAL\Exception; use Doctrine\DBAL\ParameterType; use Doctrine\DBAL\Platforms\AbstractPlatform; -use Doctrine\Deprecations\Deprecation; use function array_map; @@ -215,24 +214,4 @@ public function getMappedDatabaseTypes(AbstractPlatform $platform): array { return []; } - - /** - * If this Doctrine Type maps to an already mapped database type, - * reverse schema engineering can't tell them apart. You need to mark - * one of those types as commented, which will have Doctrine use an SQL - * comment to typehint the actual Doctrine Type. - * - * @deprecated - */ - public function requiresSQLCommentHint(AbstractPlatform $platform): bool - { - Deprecation::triggerIfCalledFromOutside( - 'doctrine/dbal', - 'https://github.com/doctrine/dbal/pull/5509', - '%s is deprecated.', - __METHOD__ - ); - - return false; - } } diff --git a/src/Types/VarDateTimeImmutableType.php b/src/Types/VarDateTimeImmutableType.php index 2bce3e3c2f9..4710d0f794f 100644 --- a/src/Types/VarDateTimeImmutableType.php +++ b/src/Types/VarDateTimeImmutableType.php @@ -8,7 +8,6 @@ use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Types\Exception\InvalidType; use Doctrine\DBAL\Types\Exception\ValueNotConvertible; -use Doctrine\Deprecations\Deprecation; use function date_create_immutable; @@ -48,19 +47,4 @@ public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?Da return $dateTime; } - - /** - * @deprecated - */ - public function requiresSQLCommentHint(AbstractPlatform $platform): bool - { - Deprecation::triggerIfCalledFromOutside( - 'doctrine/dbal', - 'https://github.com/doctrine/dbal/pull/5509', - '%s is deprecated.', - __METHOD__ - ); - - return true; - } } diff --git a/tests/Types/DateImmutableTypeTest.php b/tests/Types/DateImmutableTypeTest.php index 2c3ea71deca..4ed76630f99 100644 --- a/tests/Types/DateImmutableTypeTest.php +++ b/tests/Types/DateImmutableTypeTest.php @@ -110,9 +110,4 @@ public function testThrowsExceptionDuringConversionToPHPValueWithInvalidDateStri $this->type->convertToPHPValue('invalid date string', $this->platform); } - - public function testRequiresSQLCommentHint(): void - { - self::assertTrue($this->type->requiresSQLCommentHint($this->platform)); - } } diff --git a/tests/Types/DateIntervalTest.php b/tests/Types/DateIntervalTest.php index 7b9e61e5a25..e4f57ac7b0b 100644 --- a/tests/Types/DateIntervalTest.php +++ b/tests/Types/DateIntervalTest.php @@ -89,11 +89,6 @@ public function testDateIntervalEmptyStringConversion(): void $this->type->convertToPHPValue('', $this->platform); } - public function testRequiresSQLCommentHint(): void - { - self::assertTrue($this->type->requiresSQLCommentHint($this->platform)); - } - /** * @dataProvider invalidPHPValuesProvider */ diff --git a/tests/Types/DateTimeImmutableTypeTest.php b/tests/Types/DateTimeImmutableTypeTest.php index 9593820812a..1c5286817fa 100644 --- a/tests/Types/DateTimeImmutableTypeTest.php +++ b/tests/Types/DateTimeImmutableTypeTest.php @@ -114,9 +114,4 @@ public function testThrowsExceptionDuringConversionToPHPValueWithInvalidDateTime $this->type->convertToPHPValue('invalid datetime string', $this->platform); } - - public function testRequiresSQLCommentHint(): void - { - self::assertTrue($this->type->requiresSQLCommentHint($this->platform)); - } } diff --git a/tests/Types/DateTimeTzImmutableTypeTest.php b/tests/Types/DateTimeTzImmutableTypeTest.php index 27e8639b3c6..2739e2a3ed6 100644 --- a/tests/Types/DateTimeTzImmutableTypeTest.php +++ b/tests/Types/DateTimeTzImmutableTypeTest.php @@ -102,9 +102,4 @@ public function testThrowsExceptionDuringConversionToPHPValueWithInvalidDateTime $this->type->convertToPHPValue('invalid datetime with timezone string', $this->platform); } - - public function testRequiresSQLCommentHint(): void - { - self::assertTrue($this->type->requiresSQLCommentHint($this->platform)); - } } diff --git a/tests/Types/GuidTypeTest.php b/tests/Types/GuidTypeTest.php index 8bfd199aeef..ec43cc3aa07 100644 --- a/tests/Types/GuidTypeTest.php +++ b/tests/Types/GuidTypeTest.php @@ -32,15 +32,4 @@ public function testNullConversion(): void { self::assertNull($this->type->convertToPHPValue(null, $this->platform)); } - - public function testNativeGuidSupport(): void - { - self::assertTrue($this->type->requiresSQLCommentHint($this->platform)); - - $this->platform->expects(self::any()) - ->method('hasNativeGuidType') - ->willReturn(true); - - self::assertFalse($this->type->requiresSQLCommentHint($this->platform)); - } } diff --git a/tests/Types/JsonTest.php b/tests/Types/JsonTest.php index 6aaa6437bc1..3686896d715 100644 --- a/tests/Types/JsonTest.php +++ b/tests/Types/JsonTest.php @@ -89,11 +89,6 @@ public function testJsonResourceConvertsToPHPValue(): void self::assertSame($value, $phpValue); } - public function testRequiresSQLCommentHint(): void - { - self::assertTrue($this->type->requiresSQLCommentHint($this->platform)); - } - public function testPHPNullValueConvertsToJsonNull(): void { self::assertNull($this->type->convertToDatabaseValue(null, $this->platform)); diff --git a/tests/Types/TimeImmutableTypeTest.php b/tests/Types/TimeImmutableTypeTest.php index fef1b862306..5ef4e904454 100644 --- a/tests/Types/TimeImmutableTypeTest.php +++ b/tests/Types/TimeImmutableTypeTest.php @@ -110,9 +110,4 @@ public function testThrowsExceptionDuringConversionToPHPValueWithInvalidTimeStri $this->type->convertToPHPValue('invalid time string', $this->platform); } - - public function testRequiresSQLCommentHint(): void - { - self::assertTrue($this->type->requiresSQLCommentHint($this->platform)); - } } diff --git a/tests/Types/VarDateTimeImmutableTypeTest.php b/tests/Types/VarDateTimeImmutableTypeTest.php index f3d3f43791e..175a26afba0 100644 --- a/tests/Types/VarDateTimeImmutableTypeTest.php +++ b/tests/Types/VarDateTimeImmutableTypeTest.php @@ -88,9 +88,4 @@ public function testThrowsExceptionDuringConversionToPHPValueWithInvalidDateishS $this->type->convertToPHPValue('invalid date-ish string', $this->platform); } - - public function testRequiresSQLCommentHint(): void - { - self::assertTrue($this->type->requiresSQLCommentHint($this->platform)); - } } From 1e4983523b39bfa60531213a6ee47e033ae2fac5 Mon Sep 17 00:00:00 2001 From: Sergei Morozov Date: Fri, 15 Jul 2022 17:17:18 -0700 Subject: [PATCH 2/2] Remove AbstractPlatform::hasNative*Type() methods --- UPGRADE.md | 2 ++ psalm.xml.dist | 6 ---- src/Platforms/AbstractPlatform.php | 35 ------------------- src/Platforms/MySQLPlatform.php | 5 --- src/Platforms/PostgreSQLPlatform.php | 31 ---------------- src/Platforms/SQLServerPlatform.php | 16 --------- .../SchemaManagerFunctionalTestCase.php | 20 ----------- tests/Platforms/AbstractPlatformTestCase.php | 5 --- tests/Platforms/MariaDBPlatformTest.php | 5 --- tests/Platforms/MySQLPlatformTest.php | 5 --- tests/Platforms/PostgreSQLPlatformTest.php | 5 --- 11 files changed, 2 insertions(+), 133 deletions(-) diff --git a/UPGRADE.md b/UPGRADE.md index a120b08e927..53946d926aa 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -211,6 +211,8 @@ Postgres 9 is not actively supported anymore. The following classes have been me The following methods are removed: +- `AbstractPlatform::hasNativeJsonType()` +- `AbstractPlatform::hasNativeGuidType()` - `AbstractPlatform::isCommentedDoctrineType()` - `AbstractPlatform::initializeCommentedDoctrineTypes()` - `AbstractPlatform::markDoctrineTypeCommented()` diff --git a/psalm.xml.dist b/psalm.xml.dist index d03bd247af1..0cd277d5ace 100644 --- a/psalm.xml.dist +++ b/psalm.xml.dist @@ -39,12 +39,6 @@ See https://github.com/doctrine/dbal/pull/4317 --> - - - - diff --git a/src/Platforms/AbstractPlatform.php b/src/Platforms/AbstractPlatform.php index c48dc766c10..3b0b3e24bda 100644 --- a/src/Platforms/AbstractPlatform.php +++ b/src/Platforms/AbstractPlatform.php @@ -37,7 +37,6 @@ use Doctrine\DBAL\Types; use Doctrine\DBAL\Types\Exception\TypeNotFound; use Doctrine\DBAL\Types\Type; -use Doctrine\Deprecations\Deprecation; use InvalidArgumentException; use UnexpectedValueException; @@ -2286,40 +2285,6 @@ public function supportsCommentOnStatement(): bool return false; } - /** - * Does this platform have native guid type. - * - * @deprecated - */ - public function hasNativeGuidType(): bool - { - Deprecation::triggerIfCalledFromOutside( - 'doctrine/dbal', - 'https://github.com/doctrine/dbal/pull/5509', - '%s is deprecated.', - __METHOD__ - ); - - return false; - } - - /** - * Does this platform have native JSON type. - * - * @deprecated - */ - public function hasNativeJsonType(): bool - { - Deprecation::triggerIfCalledFromOutside( - 'doctrine/dbal', - 'https://github.com/doctrine/dbal/pull/5509', - '%s is deprecated.', - __METHOD__ - ); - - return false; - } - /** * Does this platform support column collation? */ diff --git a/src/Platforms/MySQLPlatform.php b/src/Platforms/MySQLPlatform.php index 5fb7f41ccf8..0ae96073217 100644 --- a/src/Platforms/MySQLPlatform.php +++ b/src/Platforms/MySQLPlatform.php @@ -32,11 +32,6 @@ public function getDefaultValueDeclarationSQL(array $column): string return parent::getDefaultValueDeclarationSQL($column); } - public function hasNativeJsonType(): bool - { - return true; - } - /** * {@inheritdoc} */ diff --git a/src/Platforms/PostgreSQLPlatform.php b/src/Platforms/PostgreSQLPlatform.php index 09f26a5d9cc..f73386a92f9 100644 --- a/src/Platforms/PostgreSQLPlatform.php +++ b/src/Platforms/PostgreSQLPlatform.php @@ -16,7 +16,6 @@ use Doctrine\DBAL\Schema\TableDiff; use Doctrine\DBAL\Types\BinaryType; use Doctrine\DBAL\Types\BlobType; -use Doctrine\Deprecations\Deprecation; use UnexpectedValueException; use function array_diff; @@ -155,21 +154,6 @@ public function supportsCommentOnStatement(): bool return true; } - /** - * @deprecated - */ - public function hasNativeGuidType(): bool - { - Deprecation::triggerIfCalledFromOutside( - 'doctrine/dbal', - 'https://github.com/doctrine/dbal/pull/5509', - '%s is deprecated.', - __METHOD__ - ); - - return true; - } - public function getListDatabasesSQL(): string { return 'SELECT datname FROM pg_database'; @@ -823,21 +807,6 @@ protected function initializeDoctrineTypeMappings(): void ]; } - /** - * @deprecated - */ - public function hasNativeJsonType(): bool - { - Deprecation::triggerIfCalledFromOutside( - 'doctrine/dbal', - 'https://github.com/doctrine/dbal/pull/5509', - '%s is deprecated.', - __METHOD__ - ); - - return true; - } - protected function createReservedKeywordsList(): KeywordList { return new PostgreSQLKeywords(); diff --git a/src/Platforms/SQLServerPlatform.php b/src/Platforms/SQLServerPlatform.php index 3c5ab830057..e328e3e8716 100644 --- a/src/Platforms/SQLServerPlatform.php +++ b/src/Platforms/SQLServerPlatform.php @@ -17,7 +17,6 @@ use Doctrine\DBAL\Schema\Sequence; use Doctrine\DBAL\Schema\SQLServerSchemaManager; use Doctrine\DBAL\Schema\TableDiff; -use Doctrine\Deprecations\Deprecation; use InvalidArgumentException; use function array_merge; @@ -155,21 +154,6 @@ public function getSequenceNextValSQL(string $sequence): string return 'SELECT NEXT VALUE FOR ' . $sequence; } - /** - * @deprecated - */ - public function hasNativeGuidType(): bool - { - Deprecation::triggerIfCalledFromOutside( - 'doctrine/dbal', - 'https://github.com/doctrine/dbal/pull/5509', - '%s is deprecated.', - __METHOD__ - ); - - return true; - } - public function getDropForeignKeySQL(string $foreignKey, string $table): string { return $this->getDropConstraintSQL($foreignKey, $table); diff --git a/tests/Functional/Schema/SchemaManagerFunctionalTestCase.php b/tests/Functional/Schema/SchemaManagerFunctionalTestCase.php index d67b802e1d9..fa84613c888 100644 --- a/tests/Functional/Schema/SchemaManagerFunctionalTestCase.php +++ b/tests/Functional/Schema/SchemaManagerFunctionalTestCase.php @@ -1116,26 +1116,6 @@ public function testDoesNotListIndexesImplicitlyCreatedByForeignKeys(): void self::assertArrayHasKey('idx_3d6c147fdc58d6c', $indexes); } - public function testComparatorShouldNotAddCommentToJsonTypeSinceItIsTheDefaultNow(): void - { - $platform = $this->connection->getDatabasePlatform(); - - if (! $platform->hasNativeJsonType()) { - self::markTestSkipped('This test is only supported on platforms that have native JSON type.'); - } - - $this->dropTableIfExists('json_test'); - $this->connection->executeQuery('CREATE TABLE json_test (parameters JSON NOT NULL)'); - - $table = new Table('json_test'); - $table->addColumn('parameters', 'json'); - - $tableDiff = $this->schemaManager->createComparator() - ->diffTable($this->schemaManager->listTableDetails('json_test'), $table); - - self::assertNull($tableDiff); - } - public function testCreateAndListSequences(): void { if (! $this->connection->getDatabasePlatform()->supportsSequences()) { diff --git a/tests/Platforms/AbstractPlatformTestCase.php b/tests/Platforms/AbstractPlatformTestCase.php index aa344416316..1efd3f68697 100644 --- a/tests/Platforms/AbstractPlatformTestCase.php +++ b/tests/Platforms/AbstractPlatformTestCase.php @@ -817,11 +817,6 @@ public function getExpectedVariableLengthBinaryTypeDeclarationSQLWithLength(): s return 'VARBINARY(16)'; } - public function hasNativeJsonType(): void - { - self::assertFalse($this->platform->hasNativeJsonType()); - } - public function testReturnsJsonTypeDeclarationSQL(): void { $column = [ diff --git a/tests/Platforms/MariaDBPlatformTest.php b/tests/Platforms/MariaDBPlatformTest.php index bcc8fe953c6..1df589c14cc 100644 --- a/tests/Platforms/MariaDBPlatformTest.php +++ b/tests/Platforms/MariaDBPlatformTest.php @@ -15,11 +15,6 @@ public function createPlatform(): AbstractPlatform return new MariaDBPlatform(); } - public function testHasNativeJsonType(): void - { - self::assertFalse($this->platform->hasNativeJsonType()); - } - /** * From MariaDB 10.2.7, JSON type is an alias to LONGTEXT * diff --git a/tests/Platforms/MySQLPlatformTest.php b/tests/Platforms/MySQLPlatformTest.php index 506d4d177f7..56ae4840a16 100644 --- a/tests/Platforms/MySQLPlatformTest.php +++ b/tests/Platforms/MySQLPlatformTest.php @@ -20,11 +20,6 @@ public function createPlatform(): AbstractPlatform return new MySQLPlatform(); } - public function testHasNativeJsonType(): void - { - self::assertTrue($this->platform->hasNativeJsonType()); - } - public function testReturnsJsonTypeDeclarationSQL(): void { self::assertSame('JSON', $this->platform->getJsonTypeDeclarationSQL([])); diff --git a/tests/Platforms/PostgreSQLPlatformTest.php b/tests/Platforms/PostgreSQLPlatformTest.php index 999e7983725..a426c026b85 100644 --- a/tests/Platforms/PostgreSQLPlatformTest.php +++ b/tests/Platforms/PostgreSQLPlatformTest.php @@ -897,11 +897,6 @@ public function testColumnCollationDeclarationSQL(): void ); } - public function testHasNativeJsonType(): void - { - self::assertTrue($this->platform->hasNativeJsonType()); - } - public function testReturnsJsonTypeDeclarationSQL(): void { self::assertSame('JSON', $this->platform->getJsonTypeDeclarationSQL([]));