Skip to content

Commit

Permalink
IBX-6195: Made URL_ALIAS_ROUTE_NAME calls inside URL Alias Routers …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
barw4 committed Jul 24, 2023
1 parent 7b3f233 commit b475a03
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/lib/MVC/Symfony/Routing/UrlAliasRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public function matchRequest(Request $request)
}

$params = [
'_route' => self::URL_ALIAS_ROUTE_NAME,
'_route' => static::URL_ALIAS_ROUTE_NAME,
];
switch ($urlAlias->type) {
case URLAlias::LOCATION:
Expand Down Expand Up @@ -305,7 +305,7 @@ public function generate(string $name, array $parameters = [], int $referenceTyp
}

// Normal route name
if ($name === self::URL_ALIAS_ROUTE_NAME) {
if ($name === static::URL_ALIAS_ROUTE_NAME) {
if (isset($parameters['location']) || isset($parameters['locationId'])) {
// Check if location is a valid Location object
if (isset($parameters['location']) && !$parameters['location'] instanceof Location) {
Expand Down Expand Up @@ -379,7 +379,7 @@ public function match($pathinfo)
*/
public function supports($name)
{
return $name === self::URL_ALIAS_ROUTE_NAME || $this->supportsObject($name);
return $name === static::URL_ALIAS_ROUTE_NAME || $this->supportsObject($name);
}

private function supportsObject($object): bool
Expand Down
2 changes: 1 addition & 1 deletion src/lib/MVC/Symfony/Routing/UrlWildcardRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public function match($pathinfo): array
*/
public function supports($name): bool
{
return $name === self::URL_ALIAS_ROUTE_NAME;
return $name === static::URL_ALIAS_ROUTE_NAME;
}

/**
Expand Down

0 comments on commit b475a03

Please sign in to comment.