@@ -42,7 +42,7 @@ public function match($pathinfo)
42
42
throw new MethodNotAllowedException (array_keys ($ allow ));
43
43
}
44
44
if (!$ this instanceof RedirectableUrlMatcherInterface) {
45
- throw new ResourceNotFoundException ();
45
+ throw new ResourceNotFoundException (sprintf ( ' No routes found for "%s". ' , $ pathinfo ) );
46
46
}
47
47
if (!\in_array ($ this ->context ->getMethod (), ['HEAD ' , 'GET ' ], true )) {
48
48
// no-op
@@ -67,7 +67,7 @@ public function match($pathinfo)
67
67
}
68
68
}
69
69
70
- throw new ResourceNotFoundException ();
70
+ throw new ResourceNotFoundException (sprintf ( ' No routes found for "%s". ' , $ pathinfo ) );
71
71
}
72
72
73
73
private function doMatch (string $ pathinfo , array &$ allow = [], array &$ allowSchemes = []): array
@@ -110,10 +110,8 @@ private function doMatch(string $pathinfo, array &$allow = [], array &$allowSche
110
110
}
111
111
112
112
$ hasRequiredScheme = !$ requiredSchemes || isset ($ requiredSchemes [$ context ->getScheme ()]);
113
- if ($ requiredMethods && !isset ($ requiredMethods [$ canonicalMethod ]) && !isset ($ requiredMethods [$ requestMethod ])) {
114
- if ($ hasRequiredScheme ) {
115
- $ allow += $ requiredMethods ;
116
- }
113
+ if ($ hasRequiredScheme && $ requiredMethods && !isset ($ requiredMethods [$ canonicalMethod ]) && !isset ($ requiredMethods [$ requestMethod ])) {
114
+ $ allow += $ requiredMethods ;
117
115
continue ;
118
116
}
119
117
@@ -157,15 +155,13 @@ private function doMatch(string $pathinfo, array &$allow = [], array &$allowSche
157
155
}
158
156
}
159
157
160
- $ hasRequiredScheme = !$ requiredSchemes || isset ($ requiredSchemes [$ context ->getScheme ()]);
161
- if ($ requiredMethods && !isset ($ requiredMethods [$ canonicalMethod ]) && !isset ($ requiredMethods [$ requestMethod ])) {
162
- if ($ hasRequiredScheme ) {
163
- $ allow += $ requiredMethods ;
164
- }
158
+ if ($ requiredSchemes && !isset ($ requiredSchemes [$ context ->getScheme ()])) {
159
+ $ allowSchemes += $ requiredSchemes ;
165
160
continue ;
166
161
}
167
- if (!$ hasRequiredScheme ) {
168
- $ allowSchemes += $ requiredSchemes ;
162
+
163
+ if ($ requiredMethods && !isset ($ requiredMethods [$ canonicalMethod ]) && !isset ($ requiredMethods [$ requestMethod ])) {
164
+ $ allow += $ requiredMethods ;
169
165
continue ;
170
166
}
171
167
0 commit comments