29 private $methods = [];
34 private $schemes = [];
45 public function __construct($path =
null, $host =
null, $methods = [], $schemes = [])
49 $this->methods = array_map(
'strtoupper', (array) $methods);
50 $this->schemes = array_map(
'strtolower', (array) $schemes);
60 if ($this->schemes && !in_array($request->
getUri()->getScheme(), $this->schemes)) {
64 if ($this->methods && !in_array($request->
getMethod(), $this->methods)) {
68 if (
null !== $this->path && !preg_match(
'{'.$this->path.
'}', rawurldecode($request->
getUri()->getPath()))) {
72 if (
null !== $this->host && !preg_match(
'{'.$this->host.
'}i', $request->
getUri()->getHost())) {