src/AccessRouter.php 1 location
|
@@ 178-184 (lines=7) @@
|
175 |
|
|
176 |
|
$matchedRoutes = []; |
177 |
|
|
178 |
|
foreach ($this->routes[$method] as $entry) { |
179 |
|
if (preg_match($entry->pattern, $route, $matches) > 0) { |
180 |
|
// At this point the route is matched |
181 |
|
array_shift($matches); |
182 |
|
$matchedRoutes[] = [$route, $entry, $matches]; |
183 |
|
} |
184 |
|
} |
185 |
|
|
186 |
|
if (count($matchedRoutes) == 0) { |
187 |
|
throw new ServerResponseException(new ServerResponse(404)); |
src/Router.php 1 location
|
@@ 282-287 (lines=6) @@
|
279 |
|
throw new ServerResponseException(new ServerResponse(404)); |
280 |
|
} |
281 |
|
|
282 |
|
foreach ($this->routes[$method] as $entry) { |
283 |
|
if (preg_match($entry->pattern, $route, $matches) > 0) { |
284 |
|
array_shift($matches); |
285 |
|
return [$entry->callable, $matches]; |
286 |
|
} |
287 |
|
} |
288 |
|
|
289 |
|
throw new ServerResponseException(new ServerResponse(404)); |
290 |
|
} |