17 use Psr\Http\Message\ServerRequestInterface;
46 public function addRoute($routeIdentifier, $route)
48 $this->routes[$routeIdentifier] = $route;
68 public function match($pathInfo)
70 foreach ($this->routes as $routeIdentifier => $route) {
72 if ($route->getPath() === $pathInfo) {
74 $route->
setOption(
'_identifier', $routeIdentifier);
87 public function matchRequest(ServerRequestInterface $request)
89 return $this->
match($request->getAttribute(
'routePath'));