Router Collector
Captures HTTP route matching data — matched route, pattern, arguments, match timing, and the full route tree.

What It Captures
| Field | Description |
|---|---|
currentRoute.name | Route name (if named) |
currentRoute.pattern | Route URL pattern |
currentRoute.arguments | Matched route parameters |
currentRoute.host | Host constraint (if any) |
currentRoute.uri | Actual matched URI |
currentRoute.action | Controller/action handler |
currentRoute.middlewares | Route-level middleware stack |
currentRoute.matchTime | Time to match the route (seconds) |
routes | Full route table |
routesTree | Route tree structure |
Data Schema
{
"currentRoute": {
"matchTime": 0.00012,
"name": "user.show",
"pattern": "/users/{id}",
"arguments": {"id": "42"},
"host": null,
"uri": "/users/42",
"action": "App\\Controller\\UserController::show",
"middlewares": ["auth", "throttle"]
},
"routes": [...],
"routesTree": [...],
"routeTime": 0.00012
}Summary (shown in debug entry list):
{
"router": {
"matchTime": 0.00012,
"name": "user.show",
"pattern": "/users/{id}"
}
}Contract
use AppDevPanel\Kernel\Collector\RouterCollector;
$collector->collectMatchedRoute([
'name' => 'user.show',
'pattern' => '/users/{id}',
'arguments' => ['id' => '42'],
'host' => null,
'uri' => '/users/42',
'action' => 'App\\Controller\\UserController::show',
'middlewares' => ['auth', 'throttle'],
]);
$collector->collectMatchTime(matchTime: 0.00012);
$collector->collectRoutes(routes: $allRoutes, routesTree: $routeTree);INFO
RouterCollectorAppDevPanel\Kernel\Collector\RouterCollectorCaptures HTTP routing data: matched route, match timing, route tree. implements SummaryCollectorInterfaceAppDevPanel\Kernel\Collector\SummaryCollectorInterfaceSummary data collector responsibility is to collect summary data for a collector. Summary is used to display a list of previous requests and select one to display full info. Its data set is specific to the list and is reduced compared to full data collected in {@see CollectorInterface}.. It has no dependencies on other collectors.
How It Works
Each framework adapter has a RouterDataExtractor that normalizes framework-specific route data into the common format:
- Symfony: Extracts from
RouterInterfaceand request attributes - Laravel: Extracts from Router
Illuminate\Routing\RouterLaravel Router. Registers routes and dispatches HTTP requests to controllers. facade and matchedRouteobject - Yii 3: Extracts from UrlMatcherInterface
Symfony\Component\Routing\Matcher\UrlMatcherInterfaceSymfony Routing URL Matcher. Matches a URL path to a set of route parameters. result
Debug Panel
- Matched route — current route pattern, name, and matched parameters
- Route arguments — key-value pairs of resolved parameters
- Action handler — controller class and method
- Match timing — how long route matching took