diff --git a/UPGRADE.md b/UPGRADE.md index c14fc77b786..052f761cabb 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -5,6 +5,10 @@ Please switch to one of the other mapping drivers. Native attributes which PHP supports since version 8.0 are probably your best option. +As a consequence, the following methods are deprecated: +- `ORMSetup::createAnnotationMetadataConfiguration` +- `ORMSetup::createDefaultAnnotationDriver` + ## Deprecated `Doctrine\ORM\Proxy\Proxy` interface. Use `Doctrine\Persistence\Proxy` instead to check whether proxies are initialized. diff --git a/lib/Doctrine/ORM/ORMSetup.php b/lib/Doctrine/ORM/ORMSetup.php index 3213431d737..c1f5c7edfe4 100644 --- a/lib/Doctrine/ORM/ORMSetup.php +++ b/lib/Doctrine/ORM/ORMSetup.php @@ -31,6 +31,8 @@ final class ORMSetup /** * Creates a configuration with an annotation metadata driver. * + * @deprecated Use another mapping driver. + * * @param string[] $paths */ public static function createAnnotationMetadataConfiguration( @@ -39,6 +41,12 @@ public static function createAnnotationMetadataConfiguration( ?string $proxyDir = null, ?CacheItemPoolInterface $cache = null ): Configuration { + Deprecation::trigger( + 'doctrine/orm', + 'https://github.com/doctrine/orm/issues/10098', + '%s is deprecated and will be removed in Doctrine ORM 3.0', + __METHOD__ + ); $config = self::createConfiguration($isDevMode, $proxyDir, $cache); $config->setMetadataDriverImpl(self::createDefaultAnnotationDriver($paths)); @@ -48,12 +56,20 @@ public static function createAnnotationMetadataConfiguration( /** * Adds a new default annotation driver with a correctly configured annotation reader. * + * @deprecated Use another mapping driver. + * * @param string[] $paths */ public static function createDefaultAnnotationDriver( array $paths = [], ?CacheItemPoolInterface $cache = null ): AnnotationDriver { + Deprecation::trigger( + 'doctrine/orm', + 'https://github.com/doctrine/orm/issues/10098', + '%s is deprecated and will be removed in Doctrine ORM 3.0', + __METHOD__ + ); if (! class_exists(AnnotationReader::class)) { throw new LogicException(sprintf( 'The annotation metadata driver cannot be enabled because the "doctrine/annotations" library'