mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 15:22: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:
@@ -91,7 +91,7 @@ class Router implements RouterInterface, RequestMatcherInterface
|
||||
|
||||
private static ?array $cache = [];
|
||||
|
||||
public function __construct(LoaderInterface $loader, mixed $resource, array $options = [], RequestContext $context = null, LoggerInterface $logger = null, string $defaultLocale = null)
|
||||
public function __construct(LoaderInterface $loader, mixed $resource, array $options = [], ?RequestContext $context = null, ?LoggerInterface $logger = null, ?string $defaultLocale = null)
|
||||
{
|
||||
$this->loader = $loader;
|
||||
$this->resource = $resource;
|
||||
@@ -144,7 +144,7 @@ class Router implements RouterInterface, RequestMatcherInterface
|
||||
}
|
||||
|
||||
if ($invalid) {
|
||||
throw new \InvalidArgumentException(sprintf('The Router does not support the following options: "%s".', implode('", "', $invalid)));
|
||||
throw new \InvalidArgumentException(\sprintf('The Router does not support the following options: "%s".', implode('", "', $invalid)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ class Router implements RouterInterface, RequestMatcherInterface
|
||||
public function setOption(string $key, mixed $value)
|
||||
{
|
||||
if (!\array_key_exists($key, $this->options)) {
|
||||
throw new \InvalidArgumentException(sprintf('The Router does not support the "%s" option.', $key));
|
||||
throw new \InvalidArgumentException(\sprintf('The Router does not support the "%s" option.', $key));
|
||||
}
|
||||
|
||||
$this->options[$key] = $value;
|
||||
@@ -172,7 +172,7 @@ class Router implements RouterInterface, RequestMatcherInterface
|
||||
public function getOption(string $key): mixed
|
||||
{
|
||||
if (!\array_key_exists($key, $this->options)) {
|
||||
throw new \InvalidArgumentException(sprintf('The Router does not support the "%s" option.', $key));
|
||||
throw new \InvalidArgumentException(\sprintf('The Router does not support the "%s" option.', $key));
|
||||
}
|
||||
|
||||
return $this->options[$key];
|
||||
@@ -272,6 +272,7 @@ class Router implements RouterInterface, RequestMatcherInterface
|
||||
}
|
||||
|
||||
$cache->write($dumper->dump(), $this->getRouteCollection()->getResources());
|
||||
unset(self::$cache[$cache->getPath()]);
|
||||
}
|
||||
);
|
||||
|
||||
@@ -301,6 +302,7 @@ class Router implements RouterInterface, RequestMatcherInterface
|
||||
$dumper = $this->getGeneratorDumperInstance();
|
||||
|
||||
$cache->write($dumper->dump(), $this->getRouteCollection()->getResources());
|
||||
unset(self::$cache[$cache->getPath()]);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user