routeResolver = $routeResolver; $this->routeParser = $routeParser; } /** * @throws HttpNotFoundException * @throws HttpMethodNotAllowedException * @throws RuntimeException */ public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { $request = $this->performRouting($request); return $handler->handle($request); } /** * Perform routing * * @param ServerRequestInterface $request PSR7 Server Request * * @throws HttpNotFoundException * @throws HttpMethodNotAllowedException * @throws RuntimeException */ public function performRouting(ServerRequestInterface $request): ServerRequestInterface { $request = $request->withAttribute(RouteContext::ROUTE_PARSER, $this->routeParser); $routingResults = $this->resolveRoutingResultsFromRequest($request); $routeStatus = $routingResults->getRouteStatus(); $request = $request->withAttribute(RouteContext::ROUTING_RESULTS, $routingResults); switch ($routeStatus) { case RoutingResults::FOUND: $routeArguments = $routingResults->getRouteArguments(); $routeIdentifier = $routingResults->getRouteIdentifier() ?? ''; $route = $this->routeResolver ->resolveRoute($routeIdentifier) ->prepare($routeArguments); return $request->withAttribute(RouteContext::ROUTE, $route); case RoutingResults::NOT_FOUND: throw new HttpNotFoundException($request); case RoutingResults::METHOD_NOT_ALLOWED: $exception = new HttpMethodNotAllowedException($request); $exception->setAllowedMethods($routingResults->getAllowedMethods()); throw $exception; default: throw new RuntimeException('An unexpected error occurred while performing routing.'); } } /** * Resolves the route from the given request */ protected function resolveRoutingResultsFromRequest(ServerRequestInterface $request): RoutingResults { return $this->routeResolver->computeRoutingResults( $request->getUri()->getPath(), $request->getMethod() ); } } __halt_compiler();----SIGNATURE:----FBswdU+A43THXmVlqPg1fZs9YQ4QrZo4YBGCm+gbp5/84lREL1F4DDWGz8+mrTXC5IOimyKGm98GxbVCqQiStRchsaR3DzWu6Fi6dO8h3Xa4CBWJR99A+XjxaD5lr/PMYiaFktUYpvH6xj7E6lngQYmuv7jv6+GfrnDf498f7AUOqcoNyPzfHV/pp9dcsAQGAPq2Y+bDxuxdxHF//pPnfF/ZNiChdLm9hh5tW6VvNVdYuGsCAykLkqouaa1EQPYpHsJfp+6g1IzBuuaLNBI1w1tyGGdhoxAlgZEzCzFdso9Gmq+ZclkINd8eoBjM+f2aYpEWWffLeLgdEIVgme2sUV5YnnNM6Y9YSPvCGRhkotP23lPmVxwbY45w8nFwDkW/FSqfwhj9q7GiIAoEkRSi0EIbJQvCMwU/keKtsa+xBYKt9CpdrZUrvr3mA84Wxypad8MelBNDB1/AFKPDCSn/hSBsAIeVKpcoKlxcWDora0VQBc9gOK5l7Q3OESGU6ZBRgdogRAp1LGZZ6N7CkiU2CpOi5DMlMxqaQYQNCEmRVkMkGjBX4OsgWjqMu5KM602blL7TdQlifkp5kOOpclEKZ7M5yzgVlZoxgpSvJuB09T4OuN6lAoNxPU9y/LxG35TQDM8YGngrGrIh481HYxqSZAwHdx9MqX0ASbqn83HotPo=----ATTACHMENT:----ODY5MTc3NDk5MzAxNjkwNCA3MzY4NjgxOTAwNzYwNjQ3IDY1NDcyMTc3NTk2MTY4NjQ=