class HostRequestMatcher
Checks the Request URL host name matches a regular expression.
@author Fabien Potencier <fabien@symfony.com>
Hierarchy
- class \Symfony\Component\HttpFoundation\RequestMatcher\HostRequestMatcher implements \Symfony\Component\HttpFoundation\RequestMatcherInterface
Expanded class hierarchy of HostRequestMatcher
File
-
vendor/
symfony/ http-foundation/ RequestMatcher/ HostRequestMatcher.php, line 22
Namespace
Symfony\Component\HttpFoundation\RequestMatcherView source
class HostRequestMatcher implements RequestMatcherInterface {
public function __construct(string $regexp) {
}
public function matches(Request $request) : bool {
return preg_match('{' . $this->regexp . '}i', $request->getHost());
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title |
---|---|---|---|---|
HostRequestMatcher::matches | public | function | Decides whether the rule(s) implemented by the strategy matches the supplied request. | Overrides RequestMatcherInterface::matches |
HostRequestMatcher::__construct | public | function |