mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-20 07:42:17 +02:00
N°8834 - Add compatibility with PHP 8.4 (#819)
* N°8834 - Add compatibility with PHP 8.4 * Rollback of scssphp/scssphp version upgrade due to compilation error
This commit is contained in:
@@ -239,7 +239,13 @@ class RouteCollection implements \IteratorAggregate, \Countable
|
||||
}
|
||||
|
||||
foreach ($this->aliases as $name => $alias) {
|
||||
$prefixedAliases[$prefix.$name] = $alias->withId($prefix.$alias->getId());
|
||||
$targetId = $alias->getId();
|
||||
|
||||
if (isset($this->routes[$targetId]) || isset($this->aliases[$targetId])) {
|
||||
$targetId = $prefix.$targetId;
|
||||
}
|
||||
|
||||
$prefixedAliases[$prefix.$name] = $alias->withId($targetId);
|
||||
}
|
||||
|
||||
$this->routes = $prefixedRoutes;
|
||||
@@ -387,7 +393,7 @@ class RouteCollection implements \IteratorAggregate, \Countable
|
||||
public function addAlias(string $name, string $alias): Alias
|
||||
{
|
||||
if ($name === $alias) {
|
||||
throw new InvalidArgumentException(sprintf('Route alias "%s" can not reference itself.', $name));
|
||||
throw new InvalidArgumentException(\sprintf('Route alias "%s" can not reference itself.', $name));
|
||||
}
|
||||
|
||||
unset($this->routes[$name], $this->priorities[$name]);
|
||||
@@ -407,4 +413,9 @@ class RouteCollection implements \IteratorAggregate, \Countable
|
||||
{
|
||||
return $this->aliases[$name] ?? null;
|
||||
}
|
||||
|
||||
public function getPriority(string $name): ?int
|
||||
{
|
||||
return $this->priorities[$name] ?? null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user