class ExpressionRequestMatcher
ExpressionRequestMatcher uses an expression to match a Request.
@author Fabien Potencier <fabien@symfony.com>
Hierarchy
- class \Symfony\Component\HttpFoundation\RequestMatcher\ExpressionRequestMatcher implements \Symfony\Component\HttpFoundation\RequestMatcherInterface
Expanded class hierarchy of ExpressionRequestMatcher
File
-
vendor/
symfony/ http-foundation/ RequestMatcher/ ExpressionRequestMatcher.php, line 24
Namespace
Symfony\Component\HttpFoundation\RequestMatcherView source
class ExpressionRequestMatcher implements RequestMatcherInterface {
public function __construct(ExpressionLanguage $language, Expression|string $expression) {
}
public function matches(Request $request) : bool {
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(),
]);
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title |
---|---|---|---|---|
ExpressionRequestMatcher::matches | public | function | Decides whether the rule(s) implemented by the strategy matches the supplied request. | Overrides RequestMatcherInterface::matches |
ExpressionRequestMatcher::__construct | public | function |