diff --git a/UPGRADE.md b/UPGRADE.md index 44f14436dfc..07d31971980 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -679,11 +679,13 @@ This method is unused by the DBAL since 2.0. ## Deprecated `Type::getName()` -This will method is not useful for the DBAL anymore, and will be removed in 4.0. +This method is not useful for the DBAL anymore, and will be removed in 4.0. As a consequence, depending on the name of a type being `json` for `jsonb` to be used for the Postgres platform is deprecated in favor of extending `Doctrine\DBAL\Types\JsonType`. +You can use `Type::getTypeRegistry()->lookupName($type)` instead. + ## Deprecated `AbstractPlatform::getColumnComment()`, `AbstractPlatform::getDoctrineTypeComment()`, `AbstractPlatform::hasNative*Type()` and `Type::requiresSQLCommentHint()` diff --git a/src/Types/Type.php b/src/Types/Type.php index 536cf36f2b8..2b49248ec3b 100644 --- a/src/Types/Type.php +++ b/src/Types/Type.php @@ -100,7 +100,8 @@ abstract public function getSQLDeclaration(array $column, AbstractPlatform $plat /** * Gets the name of this type. * - * @deprecated this method will be removed in Doctrine DBAL 4.0. + * @deprecated this method will be removed in Doctrine DBAL 4.0, + * use {@see TypeRegistry::lookupName()} instead. * * @return string */