From d7a119c74ca3ba0705872f3807697ac1a8076470 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Thu, 2 May 2024 13:53:42 +0200 Subject: [PATCH] fix test --- .../Bridge/Doctrine/ArgumentResolver/EntityValueResolver.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bridge/Doctrine/ArgumentResolver/EntityValueResolver.php b/src/Symfony/Bridge/Doctrine/ArgumentResolver/EntityValueResolver.php index 089a8f4856b6..d2ee05b42ce1 100644 --- a/src/Symfony/Bridge/Doctrine/ArgumentResolver/EntityValueResolver.php +++ b/src/Symfony/Bridge/Doctrine/ArgumentResolver/EntityValueResolver.php @@ -157,7 +157,7 @@ private function getIdentifier(Request $request, MapEntity $options, ArgumentMet return $id ?? ($options->stripNull ? false : null); } if ($request->attributes->has('id')) { - trigger_deprecation('symfony/doctrine-bridge', '7.2', 'Relying on auto-mapping for Doctrine entities is deprecated for argument $%s of "%s": declare the mapping using either the #[MapEntity] attribute or mapped route parameters.', $argument->getName(), $argument->getControllerName()); + trigger_deprecation('symfony/doctrine-bridge', '7.1', 'Relying on auto-mapping for Doctrine entities is deprecated for argument $%s of "%s": declare the mapping using either the #[MapEntity] attribute or mapped route parameters.', $argument->getName(), method_exists($argument, 'getControllerName') ? $argument->getControllerName() : 'n/a'); return $request->attributes->get('id') ?? ($options->stripNull ? false : null); } @@ -178,7 +178,7 @@ private function getCriteria(Request $request, MapEntity $options, ObjectManager return $criteria; } elseif (null === $mapping) { - trigger_deprecation('symfony/doctrine-bridge', '7.2', 'Relying on auto-mapping for Doctrine entities is deprecated for argument $%s of "%s": declare the identifier using either the #[MapEntity] attribute or mapped route parameters.', $argument->getName(), $argument->getControllerName()); + trigger_deprecation('symfony/doctrine-bridge', '7.1', 'Relying on auto-mapping for Doctrine entities is deprecated for argument $%s of "%s": declare the identifier using either the #[MapEntity] attribute or mapped route parameters.', $argument->getName(), method_exists($argument, 'getControllerName') ? $argument->getControllerName() : 'n/a'); $mapping = $request->attributes->keys(); }