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:
Lenaick
2026-02-26 10:36:32 +01:00
committed by GitHub
parent d4821b7edc
commit fc967c06ce
961 changed files with 12298 additions and 7130 deletions

View File

@@ -30,7 +30,7 @@ class ExpressionLanguageProvider implements ExpressionFunctionProviderInterface
private ?\Closure $getEnv;
public function __construct(callable $serviceCompiler = null, \Closure $getEnv = null)
public function __construct(?callable $serviceCompiler = null, ?\Closure $getEnv = null)
{
$this->serviceCompiler = null === $serviceCompiler ? null : $serviceCompiler(...);
$this->getEnv = $getEnv;
@@ -39,19 +39,19 @@ class ExpressionLanguageProvider implements ExpressionFunctionProviderInterface
public function getFunctions(): array
{
return [
new ExpressionFunction('service', $this->serviceCompiler ?? fn ($arg) => sprintf('$container->get(%s)', $arg), fn (array $variables, $value) => $variables['container']->get($value)),
new ExpressionFunction('service', $this->serviceCompiler ?? fn ($arg) => \sprintf('$container->get(%s)', $arg), fn (array $variables, $value) => $variables['container']->get($value)),
new ExpressionFunction('parameter', fn ($arg) => sprintf('$container->getParameter(%s)', $arg), fn (array $variables, $value) => $variables['container']->getParameter($value)),
new ExpressionFunction('parameter', fn ($arg) => \sprintf('$container->getParameter(%s)', $arg), fn (array $variables, $value) => $variables['container']->getParameter($value)),
new ExpressionFunction('env', fn ($arg) => sprintf('$container->getEnv(%s)', $arg), function (array $variables, $value) {
new ExpressionFunction('env', fn ($arg) => \sprintf('$container->getEnv(%s)', $arg), function (array $variables, $value) {
if (!$this->getEnv) {
throw new LogicException('You need to pass a getEnv closure to the expression langage provider to use the "env" function.');
throw new LogicException('You need to pass a getEnv closure to the expression language provider to use the "env" function.');
}
return ($this->getEnv)($value);
}),
new ExpressionFunction('arg', fn ($arg) => sprintf('$args?->get(%s)', $arg), fn (array $variables, $value) => $variables['args']?->get($value)),
new ExpressionFunction('arg', fn ($arg) => \sprintf('$args?->get(%s)', $arg), fn (array $variables, $value) => $variables['args']?->get($value)),
];
}
}