class ExpressionRequestMatcher in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/http-foundation/ExpressionRequestMatcher.php \Symfony\Component\HttpFoundation\ExpressionRequestMatcher
ExpressionRequestMatcher uses an expression to match a Request.
@author Fabien Potencier <fabien@symfony.com>
Hierarchy
- class \Symfony\Component\HttpFoundation\RequestMatcher implements RequestMatcherInterface
- class \Symfony\Component\HttpFoundation\ExpressionRequestMatcher
Expanded class hierarchy of ExpressionRequestMatcher
1 file declares its use of ExpressionRequestMatcher
- ExpressionRequestMatcherTest.php in vendor/
symfony/ http-foundation/ Tests/ ExpressionRequestMatcherTest.php
File
- vendor/
symfony/ http-foundation/ ExpressionRequestMatcher.php, line 21
Namespace
Symfony\Component\HttpFoundationView source
class ExpressionRequestMatcher extends RequestMatcher {
private $language;
private $expression;
public function setExpression(ExpressionLanguage $language, $expression) {
$this->language = $language;
$this->expression = $expression;
}
public function matches(Request $request) {
if (!$this->language) {
throw new \LogicException('Unable to match the request as the expression language is not available.');
}
return $this->language
->evaluate($this->expression, array(
'request' => $request,
'method' => $request
->getMethod(),
'path' => rawurldecode($request
->getPathInfo()),
'host' => $request
->getHost(),
'ip' => $request
->getClientIp(),
'attributes' => $request->attributes
->all(),
)) && parent::matches($request);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ExpressionRequestMatcher:: |
private | property | ||
ExpressionRequestMatcher:: |
private | property | ||
ExpressionRequestMatcher:: |
public | function |
Decides whether the rule(s) implemented by the strategy matches the supplied request. Overrides RequestMatcher:: |
|
ExpressionRequestMatcher:: |
public | function | ||
RequestMatcher:: |
private | property | ||
RequestMatcher:: |
private | property | ||
RequestMatcher:: |
private | property | ||
RequestMatcher:: |
private | property | ||
RequestMatcher:: |
private | property | ||
RequestMatcher:: |
private | property | ||
RequestMatcher:: |
public | function | Adds a check for request attribute. | |
RequestMatcher:: |
public | function | Adds a check for the URL host name. | |
RequestMatcher:: |
public | function | Adds a check for the client IP. | |
RequestMatcher:: |
public | function | Adds a check for the client IP. | |
RequestMatcher:: |
public | function | Adds a check for the HTTP method. | |
RequestMatcher:: |
public | function | Adds a check for the URL path info. | |
RequestMatcher:: |
public | function | Adds a check for the HTTP scheme. | |
RequestMatcher:: |
public | function |