diff --git a/DoctrineBundle.php b/DoctrineBundle.php index 6725c618..9926beab 100644 --- a/DoctrineBundle.php +++ b/DoctrineBundle.php @@ -13,9 +13,9 @@ use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\RemoveProfilerControllerPass; use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\ServiceRepositoryCompilerPass; use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\WellKnownSchemaFilterPass; -use Doctrine\Common\Util\ClassUtils; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\Proxy\Autoloader; +use Doctrine\ORM\Proxy\DefaultProxyClassNameResolver; use Symfony\Bridge\Doctrine\DependencyInjection\CompilerPass\DoctrineValidationPass; use Symfony\Bridge\Doctrine\DependencyInjection\CompilerPass\RegisterEventListenersAndSubscribersPass; use Symfony\Bridge\Doctrine\DependencyInjection\CompilerPass\RegisterUidTypePass; @@ -101,7 +101,7 @@ public function boot() $container = &$this->container; $proxyGenerator = static function ($proxyDir, $proxyNamespace, $class) use (&$container): void { - $originalClassName = ClassUtils::getRealClass($class); + $originalClassName = (new DefaultProxyClassNameResolver())->resolveClassName($class); $registry = $container->get('doctrine'); assert($registry instanceof Registry); diff --git a/composer.json b/composer.json index 6af31dc4..ff042276 100644 --- a/composer.json +++ b/composer.json @@ -32,6 +32,7 @@ "php": "^7.4 || ^8.0", "doctrine/cache": "^1.11 || ^2.0", "doctrine/dbal": "^3.7.0 || ^4.0", + "doctrine/orm": "^2.17 || ^3.0", "doctrine/persistence": "^2.2 || ^3", "doctrine/sql-formatter": "^1.0.1", "symfony/cache": "^5.4 || ^6.0 || ^7.0", @@ -48,7 +49,6 @@ "doctrine/annotations": "^1 || ^2", "doctrine/coding-standard": "^12", "doctrine/deprecations": "^1.0", - "doctrine/orm": "^2.14 || ^3.0", "friendsofphp/proxy-manager-lts": "^1.0", "phpunit/phpunit": "^9.5.26", "psalm/plugin-phpunit": "^0.18.4",