You are here

public function ExpressionRequestMatcher::matches in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-foundation/ExpressionRequestMatcher.php \Symfony\Component\HttpFoundation\ExpressionRequestMatcher::matches()

Decides whether the rule(s) implemented by the strategy matches the supplied request.

Parameters

Request $request The request to check for a match:

Return value

bool true if the request matches, false otherwise

Overrides RequestMatcher::matches

File

vendor/symfony/http-foundation/ExpressionRequestMatcher.php, line 32

Class

ExpressionRequestMatcher
ExpressionRequestMatcher uses an expression to match a Request.

Namespace

Symfony\Component\HttpFoundation

Code

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);
}