vendor/symfony/framework-bundle/Routing/RedirectableCompiledUrlMatcher.php line 22

  1. <?php
  2. /*
  3.  * This file is part of the Symfony package.
  4.  *
  5.  * (c) Fabien Potencier <fabien@symfony.com>
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. namespace Symfony\Bundle\FrameworkBundle\Routing;
  11. use Symfony\Component\Routing\Matcher\CompiledUrlMatcher;
  12. use Symfony\Component\Routing\Matcher\RedirectableUrlMatcherInterface;
  13. /**
  14.  * @author Fabien Potencier <fabien@symfony.com>
  15.  *
  16.  * @internal
  17.  */
  18. class RedirectableCompiledUrlMatcher extends CompiledUrlMatcher implements RedirectableUrlMatcherInterface
  19. {
  20.     public function redirect(string $pathstring $routestring $scheme null): array
  21.     {
  22.         return [
  23.             '_controller' => 'Symfony\\Bundle\\FrameworkBundle\\Controller\\RedirectController::urlRedirectAction',
  24.             'path' => $path,
  25.             'permanent' => true,
  26.             'scheme' => $scheme,
  27.             'httpPort' => $this->context->getHttpPort(),
  28.             'httpsPort' => $this->context->getHttpsPort(),
  29.             '_route' => $route,
  30.         ];
  31.     }
  32. }