From 2ecb4c60d25cbc979b03e1f121e809c8dace1834 Mon Sep 17 00:00:00 2001 From: Alexis Lefebvre Date: Wed, 4 Jan 2023 12:12:32 +0100 Subject: [PATCH] avoid issue with doctrine/annotations 2.0.0 --- .../FrameworkBundle/Controller/AbstractController.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Controller/AbstractController.php b/src/Symfony/Bundle/FrameworkBundle/Controller/AbstractController.php index f6eff3f61c805..441855cc0a0ca 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Controller/AbstractController.php +++ b/src/Symfony/Bundle/FrameworkBundle/Controller/AbstractController.php @@ -11,6 +11,7 @@ namespace Symfony\Bundle\FrameworkBundle\Controller; +use Doctrine\Common\Annotations\Annotation\IgnoreAnnotation; use Doctrine\Persistence\ManagerRegistry; use Psr\Container\ContainerInterface; use Psr\Link\LinkInterface; @@ -53,6 +54,10 @@ * Provides shortcuts for HTTP-related features in controllers. * * @author Fabien Potencier + * + * The following annotation is necessary for compatibility with doctrine/annotations:^2. + * + * @IgnoreAnnotation("required") */ abstract class AbstractController implements ServiceSubscriberInterface { @@ -411,7 +416,7 @@ protected function getUser() return null; } - // @deprecated since 5.4, $user will always be a UserInterface instance + // @deprecated since Symfony 5.4, $user will always be a UserInterface instance if (!\is_object($user = $token->getUser())) { // e.g. anonymous authentication return null;