diff --git a/UPGRADE.md b/UPGRADE.md index 4eedb90b0c6..099a3856ac4 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -8,6 +8,10 @@ awareness about deprecated code. # Upgrade to 4.0 +## BC BREAK: Removed `AbstractPlatform::getName()` + +The `AbstractPlatform::getName()` method has been removed. + ## BC BREAK: Removed versioned platform classes that represent the lowest supported version. The following platform-related classes have been removed: diff --git a/src/Exception/ColumnLengthRequired.php b/src/Exception/ColumnLengthRequired.php index b1859682716..ccb09eab759 100644 --- a/src/Exception/ColumnLengthRequired.php +++ b/src/Exception/ColumnLengthRequired.php @@ -7,6 +7,7 @@ use Doctrine\DBAL\Exception; use Doctrine\DBAL\Platforms\AbstractPlatform; +use function get_class; use function sprintf; /** @@ -22,8 +23,8 @@ public static function new(AbstractPlatform $platform, string $type): self { return new self( sprintf( - 'The "%s" platform requires the length of a %s column to be specified', - $platform->getName(), + '%s requires the length of a %s column to be specified', + get_class($platform), $type ) ); diff --git a/src/Platforms/AbstractPlatform.php b/src/Platforms/AbstractPlatform.php index a9b2f9e3b2f..a32295250cb 100644 --- a/src/Platforms/AbstractPlatform.php +++ b/src/Platforms/AbstractPlatform.php @@ -328,13 +328,6 @@ abstract public function getClobTypeDeclarationSQL(array $column): string; */ abstract public function getBlobTypeDeclarationSQL(array $column): string; - /** - * Gets the name of the platform. - * - * @deprecated Identify platforms by their class. - */ - abstract public function getName(): string; - /** * Registers a doctrine type to be used in conjunction with a column type of this platform. * diff --git a/src/Platforms/DB2Platform.php b/src/Platforms/DB2Platform.php index f4d5cc797c9..532ce931c41 100644 --- a/src/Platforms/DB2Platform.php +++ b/src/Platforms/DB2Platform.php @@ -14,7 +14,6 @@ use Doctrine\DBAL\Schema\TableDiff; use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Types; -use Doctrine\Deprecations\Deprecation; use function array_merge; use function count; @@ -86,17 +85,6 @@ public function getClobTypeDeclarationSQL(array $column): string return 'CLOB(1M)'; } - public function getName(): string - { - Deprecation::triggerIfCalledFromOutside( - 'doctrine/dbal', - 'https://github.com/doctrine/dbal/issues/4749', - 'DB2Platform::getName() is deprecated. Identify platforms by their class.' - ); - - return 'db2'; - } - /** * {@inheritDoc} */ diff --git a/src/Platforms/MySQLPlatform.php b/src/Platforms/MySQLPlatform.php index fe674f4f149..8714f927b1f 100644 --- a/src/Platforms/MySQLPlatform.php +++ b/src/Platforms/MySQLPlatform.php @@ -15,7 +15,6 @@ use Doctrine\DBAL\TransactionIsolationLevel; use Doctrine\DBAL\Types\BlobType; use Doctrine\DBAL\Types\TextType; -use Doctrine\Deprecations\Deprecation; use InvalidArgumentException; use function array_diff_key; @@ -916,17 +915,6 @@ public function getSetTransactionIsolationSQL(int $level): string return 'SET SESSION TRANSACTION ISOLATION LEVEL ' . $this->_getTransactionIsolationLevelSQL($level); } - public function getName(): string - { - Deprecation::triggerIfCalledFromOutside( - 'doctrine/dbal', - 'https://github.com/doctrine/dbal/issues/4749', - 'MySQLPlatform::getName() is deprecated. Identify platforms by their class.' - ); - - return 'mysql'; - } - public function getReadLockSQL(): string { return 'LOCK IN SHARE MODE'; diff --git a/src/Platforms/OraclePlatform.php b/src/Platforms/OraclePlatform.php index 68572db0299..87ecc380528 100644 --- a/src/Platforms/OraclePlatform.php +++ b/src/Platforms/OraclePlatform.php @@ -920,17 +920,6 @@ public function supportsCommentOnStatement(): bool return true; } - public function getName(): string - { - Deprecation::triggerIfCalledFromOutside( - 'doctrine/dbal', - 'https://github.com/doctrine/dbal/issues/4749', - 'OraclePlatform::getName() is deprecated. Identify platforms by their class.' - ); - - return 'oracle'; - } - protected function doModifyLimitQuery(string $query, ?int $limit, int $offset): string { if ($limit === null && $offset <= 0) { diff --git a/src/Platforms/PostgreSQLPlatform.php b/src/Platforms/PostgreSQLPlatform.php index 539f9f37c4b..b7e4ad6a6fe 100644 --- a/src/Platforms/PostgreSQLPlatform.php +++ b/src/Platforms/PostgreSQLPlatform.php @@ -922,17 +922,6 @@ public function getClobTypeDeclarationSQL(array $column): string return 'TEXT'; } - public function getName(): string - { - Deprecation::triggerIfCalledFromOutside( - 'doctrine/dbal', - 'https://github.com/doctrine/dbal/issues/4749', - 'PostgreSQLPlatform::getName() is deprecated. Identify platforms by their class.' - ); - - return 'postgresql'; - } - public function getDateTimeTzFormatString(): string { return 'Y-m-d H:i:sO'; diff --git a/src/Platforms/SQLServerPlatform.php b/src/Platforms/SQLServerPlatform.php index a795c3a5cdc..1257002fb11 100644 --- a/src/Platforms/SQLServerPlatform.php +++ b/src/Platforms/SQLServerPlatform.php @@ -17,7 +17,6 @@ use Doctrine\DBAL\Schema\Sequence; use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Schema\TableDiff; -use Doctrine\Deprecations\Deprecation; use InvalidArgumentException; use function array_merge; @@ -1284,17 +1283,6 @@ public function getDateTimeTzFormatString(): string return 'Y-m-d H:i:s.u P'; } - public function getName(): string - { - Deprecation::triggerIfCalledFromOutside( - 'doctrine/dbal', - 'https://github.com/doctrine/dbal/issues/4749', - 'SQLServerPlatform::getName() is deprecated. Identify platforms by their class.' - ); - - return 'mssql'; - } - protected function initializeDoctrineTypeMappings(): void { $this->doctrineTypeMapping = [ diff --git a/src/Platforms/SqlitePlatform.php b/src/Platforms/SqlitePlatform.php index f399064980a..e5c5ff5f161 100644 --- a/src/Platforms/SqlitePlatform.php +++ b/src/Platforms/SqlitePlatform.php @@ -492,17 +492,6 @@ public function supportsInlineColumnComments(): bool return true; } - public function getName(): string - { - Deprecation::triggerIfCalledFromOutside( - 'doctrine/dbal', - 'https://github.com/doctrine/dbal/issues/4749', - 'SqlitePlatform::getName() is deprecated. Identify platforms by their class.' - ); - - return 'sqlite'; - } - public function getTruncateTableSQL(string $tableName, bool $cascade = false): string { $tableIdentifier = new Identifier($tableName); diff --git a/tests/Platforms/DB2PlatformTest.php b/tests/Platforms/DB2PlatformTest.php index 6464d2738e6..d38f9006dbe 100644 --- a/tests/Platforms/DB2PlatformTest.php +++ b/tests/Platforms/DB2PlatformTest.php @@ -171,11 +171,6 @@ public function getCreateTableColumnTypeCommentsSQL(): array ]; } - public function testHasCorrectPlatformName(): void - { - self::assertEquals('db2', $this->platform->getName()); - } - public function testGeneratesCreateTableSQLWithCommonIndexes(): void { $table = new Table('test');