From 32b9912accd3c35c7830a068af7de189bdde7136 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Gertz?= Date: Thu, 7 Mar 2024 18:47:36 +0100 Subject: [PATCH] Remove getAlias member function Cleanup --- Handler/AuthenticationFailureHandler.php | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/Handler/AuthenticationFailureHandler.php b/Handler/AuthenticationFailureHandler.php index c5d0ec5..01a4b12 100644 --- a/Handler/AuthenticationFailureHandler.php +++ b/Handler/AuthenticationFailureHandler.php @@ -12,7 +12,9 @@ namespace Rapsys\UserBundle\Handler; use Doctrine\Persistence\ManagerRegistry; + use Psr\Log\LoggerInterface; + use Symfony\Bridge\Twig\Mime\TemplatedEmail; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\RedirectResponse; @@ -36,6 +38,7 @@ use Symfony\Component\Security\Http\HttpUtils; use Symfony\Contracts\Translation\TranslatorInterface; use Rapsys\PackBundle\Util\SluggerUtil; + use Rapsys\UserBundle\Exception\UnactivatedException; use Rapsys\UserBundle\RapsysUserBundle; @@ -55,6 +58,8 @@ class AuthenticationFailureHandler extends DefaultAuthenticationFailureHandler { ]; /** + * {@inheritdoc} + * * @xxx Second argument will be replaced by security.firewalls.main.logout.target * @see vendor/symfony/security-bundle/DependencyInjection/SecurityExtension.php +360 * @@ -69,15 +74,13 @@ class AuthenticationFailureHandler extends DefaultAuthenticationFailureHandler { * @param SluggerUtil $slugger The slugger instance * @param RequestStack $stack The stack instance * @param TranslatorInterface $translator The translator instance - * - * {@inheritdoc} */ public function __construct(protected HttpKernelInterface $httpKernel, protected HttpUtils $httpUtils, protected array $options, protected ?LoggerInterface $logger, protected ContainerInterface $container, protected ManagerRegistry $doctrine, protected MailerInterface $mailer, protected RouterInterface $router, protected SluggerUtil $slugger, protected RequestStack $stack, protected TranslatorInterface $translator) { //Call parent constructor parent::__construct($httpKernel, $httpUtils, $options, $logger); //Set config - $this->config = $container->getParameter(self::getAlias()); + $this->config = $container->getParameter(RapsysUserBundle::getAlias()); } /** @@ -100,9 +103,9 @@ class AuthenticationFailureHandler extends DefaultAuthenticationFailureHandler { } /** - * This is called when an interactive authentication attempt fails - * * {@inheritdoc} + * + * This is called when an interactive authentication attempt fails */ public function onAuthenticationFailure(Request $request, AuthenticationException $exception): Response { //With bad credential exception @@ -299,11 +302,4 @@ class AuthenticationFailureHandler extends DefaultAuthenticationFailureHandler { //Call parent function return parent::onAuthenticationFailure($request, $exception); } - - /** - * {@inheritdoc} - */ - public function getAlias(): string { - return RapsysUserBundle::getAlias(); - } } -- 2.41.1