Skip to content

Commit

Permalink
Added redirectable url matcher
Browse files Browse the repository at this point in the history
  • Loading branch information
simba77 committed Feb 3, 2024
1 parent 71af8df commit 488b749
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions system/src/Router/UrlMatcher.php
@@ -0,0 +1,22 @@
<?php

declare(strict_types=1);

namespace Johncms\Router;

use Symfony\Component\Routing\Matcher\RedirectableUrlMatcher;
use Symfony\Component\Routing\Matcher\RedirectableUrlMatcherInterface;

class UrlMatcher extends RedirectableUrlMatcher implements RedirectableUrlMatcherInterface
{
public function redirect(string $path, string $route, ?string $scheme = null): array
{
return [
'redirect' => [
'path' => $path,
'route' => $route,
'scheme' => $scheme,
],
];
}
}

0 comments on commit 488b749

Please sign in to comment.