Skip to content

Commit b475a03

Browse files
authored
IBX-6195: Made URL_ALIAS_ROUTE_NAME calls inside URL Alias Routers static (#246)
For more details see https://issues.ibexa.co/browse/IBX-6195 and #246 * Made `URL_ALIAS_ROUTE_NAME` calls inside `MVC\Symfony\Routing\UrlAliasRouter` static * Made `URL_ALIAS_ROUTE_NAME` call inside `MVC\Symfony\Routing\UrlWildcardRouter` static
1 parent 7b3f233 commit b475a03

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/lib/MVC/Symfony/Routing/UrlAliasRouter.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function matchRequest(Request $request)
109109
}
110110

111111
$params = [
112-
'_route' => self::URL_ALIAS_ROUTE_NAME,
112+
'_route' => static::URL_ALIAS_ROUTE_NAME,
113113
];
114114
switch ($urlAlias->type) {
115115
case URLAlias::LOCATION:
@@ -305,7 +305,7 @@ public function generate(string $name, array $parameters = [], int $referenceTyp
305305
}
306306

307307
// Normal route name
308-
if ($name === self::URL_ALIAS_ROUTE_NAME) {
308+
if ($name === static::URL_ALIAS_ROUTE_NAME) {
309309
if (isset($parameters['location']) || isset($parameters['locationId'])) {
310310
// Check if location is a valid Location object
311311
if (isset($parameters['location']) && !$parameters['location'] instanceof Location) {
@@ -379,7 +379,7 @@ public function match($pathinfo)
379379
*/
380380
public function supports($name)
381381
{
382-
return $name === self::URL_ALIAS_ROUTE_NAME || $this->supportsObject($name);
382+
return $name === static::URL_ALIAS_ROUTE_NAME || $this->supportsObject($name);
383383
}
384384

385385
private function supportsObject($object): bool

src/lib/MVC/Symfony/Routing/UrlWildcardRouter.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public function match($pathinfo): array
151151
*/
152152
public function supports($name): bool
153153
{
154-
return $name === self::URL_ALIAS_ROUTE_NAME;
154+
return $name === static::URL_ALIAS_ROUTE_NAME;
155155
}
156156

157157
/**

0 commit comments

Comments
 (0)