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/Schema/AbstractSchemaManager.php b/src/Schema/AbstractSchemaManager.php index 445c9ff2fb8..7da2b1178db 100644 --- a/src/Schema/AbstractSchemaManager.php +++ b/src/Schema/AbstractSchemaManager.php @@ -442,7 +442,7 @@ protected function doListTables(): array */ public function listTableDetails($name) { - Deprecation::trigger( + Deprecation::triggerIfCalledFromOutside( 'doctrine/dbal', 'https://github.com/doctrine/dbal/pull/5595', '%s is deprecated. Use introspectTable() instead.', diff --git a/src/Schema/DB2SchemaManager.php b/src/Schema/DB2SchemaManager.php index eec1abbd713..a07136fecb2 100644 --- a/src/Schema/DB2SchemaManager.php +++ b/src/Schema/DB2SchemaManager.php @@ -50,7 +50,7 @@ public function listTables() */ public function listTableDetails($name) { - Deprecation::trigger( + Deprecation::triggerIfCalledFromOutside( 'doctrine/dbal', 'https://github.com/doctrine/dbal/pull/5595', '%s is deprecated. Use introspectTable() instead.', diff --git a/src/Schema/MySQLSchemaManager.php b/src/Schema/MySQLSchemaManager.php index 0f3c6ee6f6c..5faae24fa30 100644 --- a/src/Schema/MySQLSchemaManager.php +++ b/src/Schema/MySQLSchemaManager.php @@ -73,7 +73,7 @@ public function listTables() */ public function listTableDetails($name) { - Deprecation::trigger( + Deprecation::triggerIfCalledFromOutside( 'doctrine/dbal', 'https://github.com/doctrine/dbal/pull/5595', '%s is deprecated. Use introspectTable() instead.', diff --git a/src/Schema/OracleSchemaManager.php b/src/Schema/OracleSchemaManager.php index 9ab32a998c0..07375221460 100644 --- a/src/Schema/OracleSchemaManager.php +++ b/src/Schema/OracleSchemaManager.php @@ -51,7 +51,7 @@ public function listTables() */ public function listTableDetails($name) { - Deprecation::trigger( + Deprecation::triggerIfCalledFromOutside( 'doctrine/dbal', 'https://github.com/doctrine/dbal/pull/5595', '%s is deprecated. Use introspectTable() instead.', diff --git a/src/Schema/PostgreSQLSchemaManager.php b/src/Schema/PostgreSQLSchemaManager.php index bd708e3533d..13fde63b2b8 100644 --- a/src/Schema/PostgreSQLSchemaManager.php +++ b/src/Schema/PostgreSQLSchemaManager.php @@ -63,7 +63,7 @@ public function listTables() */ public function listTableDetails($name) { - Deprecation::trigger( + Deprecation::triggerIfCalledFromOutside( 'doctrine/dbal', 'https://github.com/doctrine/dbal/pull/5595', '%s is deprecated. Use introspectTable() instead.', diff --git a/src/Schema/SQLServerSchemaManager.php b/src/Schema/SQLServerSchemaManager.php index f717593af31..64538e6898c 100644 --- a/src/Schema/SQLServerSchemaManager.php +++ b/src/Schema/SQLServerSchemaManager.php @@ -55,7 +55,7 @@ public function listTables() */ public function listTableDetails($name) { - Deprecation::trigger( + Deprecation::triggerIfCalledFromOutside( 'doctrine/dbal', 'https://github.com/doctrine/dbal/pull/5595', '%s is deprecated. Use introspectTable() instead.', 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 */