X-Git-Url: https://git.rapsys.eu/userbundle/blobdiff_plain/776c977f27292e536619c2bd70cabdbcc118d5e4..a903a67360bb844142ccb3e6b9a84953b5291a28:/Handler/LogoutSuccessHandler.php diff --git a/Handler/LogoutSuccessHandler.php b/Handler/LogoutSuccessHandler.php index 57392dd..4c194c5 100644 --- a/Handler/LogoutSuccessHandler.php +++ b/Handler/LogoutSuccessHandler.php @@ -1,10 +1,20 @@ - + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ namespace Rapsys\UserBundle\Handler; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Exception\ResourceNotFoundException; use Symfony\Component\Routing\RequestContext; use Symfony\Component\Routing\RouterInterface; @@ -32,9 +42,12 @@ class LogoutSuccessHandler extends DefaultLogoutSuccessHandler { protected $targetUrl; /** + * @xxx Second argument will be replaced by security.firewalls.main.logout.target + * @see vendor/symfony/security-bundle/DependencyInjection/SecurityExtension.php +360 + * * {@inheritdoc} */ - public function __construct(ContainerInterface $container, string $targetUrl = '/', RouterInterface $router) { + public function __construct(ContainerInterface $container, string $targetUrl, RouterInterface $router) { //Set config $this->config = $container->getParameter(self::getAlias()); @@ -48,7 +61,7 @@ class LogoutSuccessHandler extends DefaultLogoutSuccessHandler { /** * {@inheritdoc} */ - public function onLogoutSuccess(Request $request) { + public function onLogoutSuccess(Request $request): Response { //Retrieve logout route $logout = $request->get('_route'); @@ -110,7 +123,7 @@ class LogoutSuccessHandler extends DefaultLogoutSuccessHandler { //With index route from config if (!empty($name = $this->config['route']['index']['name']) && is_array($context = $this->config['route']['index']['context'])) { //Without logout route name - if (($name = $route['_route']) != $logout) { + if ($name != $logout) { //Try index route try { //Generate url