@@ -91,8 +91,11 @@ public function getRouteCollection()
91
91
*/
92
92
public function getMatcher ()
93
93
{
94
- // we may not set the context in DynamicRouter::setContext as this would lead to symfony cache warmup problems
95
- // a request matcher does not need the request context separately as it can get it from the request.
94
+ /* we may not set the context in DynamicRouter::setContext as this
95
+ * would lead to symfony cache warmup problems.
96
+ * a request matcher does not need the request context separately as it
97
+ * can get it from the request.
98
+ */
96
99
if ($ this ->matcher instanceof RequestContextAwareInterface) {
97
100
$ this ->matcher ->setContext ($ this ->getContext ());
98
101
}
@@ -113,8 +116,8 @@ public function getGenerator()
113
116
/**
114
117
* Generates a URL from the given parameters.
115
118
*
116
- * If the generator is not able to generate the url, it must throw the RouteNotFoundException
117
- * as documented below.
119
+ * If the generator is not able to generate the url, it must throw the
120
+ * RouteNotFoundException as documented below.
118
121
*
119
122
* @param string $name The name of the route
120
123
* @param mixed $parameters An array of parameters
@@ -151,12 +154,14 @@ public function supports($name)
151
154
* If the matcher can not find information, it must throw one of the
152
155
* exceptions documented below.
153
156
*
154
- * @param string $pathinfo The path info to be parsed (raw format, i.e. not urldecoded)
157
+ * @param string $pathinfo The path info to be parsed (raw format, i.e. not
158
+ * urldecoded)
155
159
*
156
160
* @return array An array of parameters
157
161
*
158
162
* @throws ResourceNotFoundException If the resource could not be found
159
- * @throws MethodNotAllowedException If the resource was found but the request method is not allowed
163
+ * @throws MethodNotAllowedException If the resource was found but the
164
+ * request method is not allowed
160
165
*
161
166
* @api
162
167
*/
@@ -188,16 +193,20 @@ public function match($pathinfo)
188
193
* @return array An array of parameters
189
194
*
190
195
* @throws ResourceNotFoundException If no matching resource could be found
191
- * @throws MethodNotAllowedException If a matching resource was found but the request method is not allowed
196
+ * @throws MethodNotAllowedException If a matching resource was found but
197
+ * the request method is not allowed
192
198
*/
193
199
public function matchRequest (Request $ request )
194
200
{
195
- if (! empty ($ this ->uriFilterRegexp ) && ! preg_match ($ this ->uriFilterRegexp , $ request ->getPathInfo ())) {
201
+ if (! empty ($ this ->uriFilterRegexp )
202
+ && ! preg_match ($ this ->uriFilterRegexp , $ request ->getPathInfo ())
203
+ ) {
196
204
throw new ResourceNotFoundException ("{$ request ->getPathInfo ()} does not match the ' {$ this ->uriFilterRegexp }' pattern " );
197
205
}
198
206
199
207
$ matcher = $ this ->getMatcher ();
200
208
if ($ matcher instanceof UrlMatcherInterface) {
209
+ // the match method will enhance the route $defaults
201
210
return $ this ->match ($ request ->getPathInfo ());
202
211
}
203
212
0 commit comments