Repository: doctrine-extensions/DoctrineExtensions (language: php)

Issue:
doctrine/persistence v3 is not allowed
This repository is restricting `doctrine/persistence` to version 2.
Unless some changes introduced in v3 are blocking, the new version should be allowed as well.


Discussion / hints:
#2448 points out one blocker.  It looks like #2373 gave a way to fix it in downstream applications (and https://github.com/stof/StofDoctrineExtensionsBundle/pull/436 exists to help users of that Symfony bundle apply it), but the two places still calling that deprecated `Doctrine\Persistence\Mapping\AbstractMetadata::getCacheDriver()` method still need some kind of conditional logic to not fail hard with 3.0 installed.

It looks like https://github.com/doctrine/persistence/blob/3.0.x/UPGRADE.md#bc-break-removed-lifecycleeventargsgetentity could potentially be an issue, hard to say on a quick scan though because of how much dynamic code is involved in pushing the event args object through to the adapters.

Off hand, I don't know if there's anything in this package supporting short namespace aliases, but that's gone too - https://github.com/doctrine/persistence/blob/3.0.x/UPGRADE.md#bc-break-removed-support-for-short-namespace-aliases

Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 77f029dab..639c8f92d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -19,6 +19,9 @@ a release.
 ---
 
 ## [Unreleased]
+## Added
+- Add support for doctrine/persistence 3
+
 ## Changed
 - Removed call to deprecated `ClassMetadataFactory::getCacheDriver()` method.
 - Dropped support for doctrine/mongodb-odm < 2.3.
diff --git a/composer.json b/composer.json
index 7903c9740..4261870cd 100644
--- a/composer.json
+++ b/composer.json
@@ -45,7 +45,7 @@
         "doctrine/collections": "^1.0",
         "doctrine/common": "^2.13 || ^3.0",
         "doctrine/event-manager": "^1.0",
-        "doctrine/persistence": "^2.2",
+        "doctrine/persistence": "^2.2 || ^3.0",
         "psr/cache": "^1 || ^2 || ^3",
         "symfony/cache": "^4.4 || ^5.3 || ^6.0"
     },


Test patch: