function AttributesRequestMatcher::matches
Overrides RequestMatcherInterface::matches
File
-
vendor/
symfony/ http-foundation/ RequestMatcher/ AttributesRequestMatcher.php, line 31
Class
- AttributesRequestMatcher
- Checks the Request attributes matches all regular expressions.
Namespace
Symfony\Component\HttpFoundation\RequestMatcherCode
public function matches(Request $request) : bool {
foreach ($this->regexps as $key => $regexp) {
$attribute = $request->attributes
->get($key);
if (!\is_string($attribute)) {
return false;
}
if (!preg_match('{' . $regexp . '}', $attribute)) {
return false;
}
}
return true;
}