From: Raphaƫl Gertz Date: Tue, 7 Sep 2021 13:37:41 +0000 (+0200) Subject: Fix optional argument warning X-Git-Tag: 0.2.0~18 X-Git-Url: https://git.rapsys.eu/userbundle/commitdiff_plain/a903a67360bb844142ccb3e6b9a84953b5291a28 Fix optional argument warning Fix undefined route variable --- diff --git a/Handler/LogoutSuccessHandler.php b/Handler/LogoutSuccessHandler.php index 825cd5b..4c194c5 100644 --- a/Handler/LogoutSuccessHandler.php +++ b/Handler/LogoutSuccessHandler.php @@ -47,7 +47,7 @@ class LogoutSuccessHandler extends DefaultLogoutSuccessHandler { * * {@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()); @@ -123,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