Router
Minimal {@see RouterInterface} implementation: exact segments plus single-segment `{placeholder}`s. Never throws, never returns null — {@see RouteResult} carries the outcome, exactly as the published contract demands. Ported (not reimplemented from scratch) from `example-agent-ready-blog`'s `App\Http\Router` — `milpa/http` ships the `RouterInterface` contract and the route/result value objects but no concrete matcher, and the example already proved this exact shape against the real published types. See the front's report for why this is a port and not a `milpa/http` dependency.
Router::__construct()
public function __construct(Milpa\Http\Routing\Route ...$routes):Parameters
| Name | Type | Description |
|---|---|---|
| $routes | Milpa\Http\Routing\Route |
Router::match()
public function match(Psr\Http\Message\ServerRequestInterface $request): Milpa\Http\Routing\RouteResultResolves the request to a typed result — always MATCHED, NOT_FOUND or METHOD_NOT_ALLOWED, never null.
Parameters
| Name | Type | Description |
|---|---|---|
| $request | Psr\Http\Message\ServerRequestInterface |