Upgrade framework

This commit is contained in:
2023-11-14 16:54:35 +01:00
parent 1648a5cd42
commit 4fcf6fffcc
10548 changed files with 693138 additions and 466698 deletions

View File

@@ -11,6 +11,7 @@
namespace Symfony\Component\HttpFoundation;
use Symfony\Component\ExpressionLanguage\Expression;
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
/**
@@ -23,25 +24,25 @@ class ExpressionRequestMatcher extends RequestMatcher
private $language;
private $expression;
public function setExpression(ExpressionLanguage $language, $expression)
public function setExpression(ExpressionLanguage $language, Expression|string $expression)
{
$this->language = $language;
$this->expression = $expression;
}
public function matches(Request $request)
public function matches(Request $request): bool
{
if (!$this->language) {
if (!isset($this->language)) {
throw new \LogicException('Unable to match the request as the expression language is not available.');
}
return $this->language->evaluate($this->expression, array(
return $this->language->evaluate($this->expression, [
'request' => $request,
'method' => $request->getMethod(),
'path' => rawurldecode($request->getPathInfo()),
'host' => $request->getHost(),
'ip' => $request->getClientIp(),
'attributes' => $request->attributes->all(),
)) && parent::matches($request);
]) && parent::matches($request);
}
}