Upgrade 1-11.38

This commit is contained in:
xesmyd
2026-03-30 14:10:30 +02:00
parent f2a7e6d1fc
commit ac648ef29d
24665 changed files with 69682 additions and 2205004 deletions
+5 -17
View File
@@ -13,8 +13,6 @@ namespace Symfony\Component\ExpressionLanguage;
use Psr\Cache\CacheItemPoolInterface;
use Symfony\Component\Cache\Adapter\ArrayAdapter;
use Symfony\Component\ExpressionLanguage\ParserCache\ParserCacheAdapter;
use Symfony\Component\ExpressionLanguage\ParserCache\ParserCacheInterface;
/**
* Allows to compile and evaluate expressions written in your own DSL.
@@ -31,21 +29,11 @@ class ExpressionLanguage
protected $functions = [];
/**
* @param CacheItemPoolInterface $cache
* @param ExpressionFunctionProviderInterface[] $providers
*/
public function __construct($cache = null, array $providers = [])
public function __construct(CacheItemPoolInterface $cache = null, array $providers = [])
{
if (null !== $cache) {
if ($cache instanceof ParserCacheInterface) {
@trigger_error(sprintf('Passing an instance of %s as constructor argument for %s is deprecated as of 3.2 and will be removed in 4.0. Pass an instance of %s instead.', ParserCacheInterface::class, self::class, CacheItemPoolInterface::class), \E_USER_DEPRECATED);
$cache = new ParserCacheAdapter($cache);
} elseif (!$cache instanceof CacheItemPoolInterface) {
throw new \InvalidArgumentException(sprintf('Cache argument has to implement "%s".', CacheItemPoolInterface::class));
}
}
$this->cache = $cache ?: new ArrayAdapter();
$this->cache = $cache ?? new ArrayAdapter();
$this->registerFunctions();
foreach ($providers as $provider) {
$this->registerProvider($provider);
@@ -149,7 +137,7 @@ class ExpressionLanguage
$this->addFunction(ExpressionFunction::fromPhp('constant'));
}
private function getLexer()
private function getLexer(): Lexer
{
if (null === $this->lexer) {
$this->lexer = new Lexer();
@@ -158,7 +146,7 @@ class ExpressionLanguage
return $this->lexer;
}
private function getParser()
private function getParser(): Parser
{
if (null === $this->parser) {
$this->parser = new Parser($this->functions);
@@ -167,7 +155,7 @@ class ExpressionLanguage
return $this->parser;
}
private function getCompiler()
private function getCompiler(): Compiler
{
if (null === $this->compiler) {
$this->compiler = new Compiler($this->functions);