class AttributesRequestMatcher
Checks the Request attributes matches all regular expressions.
@author Fabien Potencier <fabien@symfony.com>
Hierarchy
- class \Symfony\Component\HttpFoundation\RequestMatcher\AttributesRequestMatcher implements \Symfony\Component\HttpFoundation\RequestMatcherInterface
Expanded class hierarchy of AttributesRequestMatcher
File
-
vendor/
symfony/ http-foundation/ RequestMatcher/ AttributesRequestMatcher.php, line 22
Namespace
Symfony\Component\HttpFoundation\RequestMatcherView source
class AttributesRequestMatcher implements RequestMatcherInterface {
/**
* @param array<string, string> $regexps
*/
public function __construct(array $regexps) {
}
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;
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title |
---|---|---|---|---|
AttributesRequestMatcher::matches | public | function | Decides whether the rule(s) implemented by the strategy matches the supplied request. | Overrides RequestMatcherInterface::matches |
AttributesRequestMatcher::__construct | public | function |