]> Raphaël G. Git Repositories - userbundle/commitdiff
Fix optional argument warning
authorRaphaël Gertz <git@rapsys.eu>
Tue, 7 Sep 2021 13:37:41 +0000 (15:37 +0200)
committerRaphaël Gertz <git@rapsys.eu>
Tue, 7 Sep 2021 13:37:41 +0000 (15:37 +0200)
Fix undefined route variable

Handler/LogoutSuccessHandler.php

index 825cd5b69bd5a7f973a0ad9b78185b5fca4ede3e..4c194c5be8df25f96ec95f0eb559bbe5eb5f8d35 100644 (file)
@@ -47,7 +47,7 @@ class LogoutSuccessHandler extends DefaultLogoutSuccessHandler {
         *
         * {@inheritdoc}
         */
         *
         * {@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());
 
                //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
                //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
                                //Try index route
                                try {
                                        //Generate url