getMethod(); $uri = $request->getUri()->getPath(); $match = $this->dispatch($method, $uri); switch ($match[0]) { case FastRoute::NOT_FOUND: $this->setNotFoundDecoratorMiddleware(); break; case FastRoute::METHOD_NOT_ALLOWED: $allowed = (array) $match[1]; $this->setMethodNotAllowedDecoratorMiddleware($allowed); break; case FastRoute::FOUND: $route = $this->ensureHandlerIsRoute($match[1], $method, $uri)->setVars($match[2]); if ($this->isExtraConditionMatch($route, $request)) { $this->setFoundMiddleware($route); $request = $this->requestWithRouteAttributes($request, $route); break; } $this->setNotFoundDecoratorMiddleware(); break; } return $this->handle($request); } public function handle(\Psr\Http\Message\ServerRequestInterface $request): \Psr\Http\Message\ResponseInterface { $middleware = $this->shiftMiddleware(); return $middleware->process($request, $this); } protected function ensureHandlerIsRoute($matchingHandler, $httpMethod, $uri): Route { if ($matchingHandler instanceof Route) { return $matchingHandler; } return new Route($httpMethod, $uri, $matchingHandler); } protected function requestWithRouteAttributes( \Psr\Http\Message\ServerRequestInterface $request, Route $route, ): \Psr\Http\Message\ServerRequestInterface { $routerParams = $route->getVars(); foreach ($routerParams as $key => $value) { $request = $request->withAttribute($key, $value); } return $request; } protected function setFoundMiddleware(Route $route): void { if ($route->getStrategy() === null) { $strategy = $this->getStrategy(); if (!($strategy instanceof Strategy\StrategyInterface)) { throw new RuntimeException('Cannot determine strategy to use for dispatch of found route'); } $route->setStrategy($strategy); } $strategy = $route->getStrategy(); $container = $strategy instanceof ContainerAwareInterface ? $strategy->getContainer() : null; foreach ($this->getMiddlewareStack() as $key => $middleware) { $this->middleware[$key] = $this->resolveMiddleware($middleware, $container); } // wrap entire dispatch process in exception handler $this->prependMiddleware($strategy->getThrowableHandler()); // add group and route specific middleware if ($group = $route->getParentGroup()) { foreach ($group->getMiddlewareStack() as $middleware) { $this->middleware($this->resolveMiddleware($middleware, $container)); } } foreach ($route->getMiddlewareStack() as $middleware) { $this->middleware($this->resolveMiddleware($middleware, $container)); } // add actual route to end of stack $this->middleware($route); } protected function setMethodNotAllowedDecoratorMiddleware(array $allowed): void { $strategy = $this->getStrategy(); if (!($strategy instanceof Strategy\StrategyInterface)) { throw new RuntimeException('Cannot determine strategy to use for dispatch of method not allowed route'); } $middleware = $strategy->getMethodNotAllowedDecorator(new Http\Exception\MethodNotAllowedException($allowed)); $this->prependMiddleware($middleware); } protected function setNotFoundDecoratorMiddleware(): void { $strategy = $this->getStrategy(); if (!($strategy instanceof Strategy\StrategyInterface)) { throw new RuntimeException('Cannot determine strategy to use for dispatch of not found route'); } $middleware = $strategy->getNotFoundDecorator(new Http\Exception\NotFoundException()); $this->prependMiddleware($middleware); } } __halt_compiler();----SIGNATURE:----FvCCMMZOZHbg0iyqajd5/6+igYQA8WTAGZbAMoO55CJ2IuqVxXlSn5Mjy0FNe8A/K4P5WtS9L8s9yj69/5tl/M/eOL0t5Iv7b8D+Js/NeWwR4GuATLuM+UM/xOsdtsW80xUeWR/D6Vjr2UNvHetKsIshyWzrVubpTUNsf25hmUa2sF0cNZkPYYZAYg/ckIKKZ1oGEpdREhDkIxUlKFBK0LjGY06aumDGU2ZabAI+D4OQnVakn8JP92bkKdTxP6uchMrR1pxdBITlclwef8sOcwlf1k0nDAfSyXXkwTVTr9ZrLsi7ka68slh3XiSL403mUWFq6HYh65hfIC+XliXQxITLa/MRq98sAmQMgq8TvcTLYGMXsPKV3JsrQ2VECiH9k2pAimyCevn/Y5udHoETiMI5ERlLrGLlNFIcudZdTSOsqA5QUWPvnUWKEKNDU17+B/xPTNxCF7cXXcsIbRs5uXrLexShhFCux8pM/oONeNNetd2cXuTI13JVkWK+y5ZiDSxK6Lhxuji/Bp/htLxrK5Rxh9DYk8NTWMhzT6bu/YRb/fjfkPtYbebVtZJ54ZWAnXXopyNm2iqqQdzPoHy6QipOX0PPZs9RGceyxyvIToKZHDd4Op30/qbaTsVqYAzFU9TbizUE4JscTond13PjdVfF86OkdXclAbIrD8i3gIQ=----ATTACHMENT:----MTE2MTc3OTE0NDA1MDc3MCAzNTMxMzk2NDk5NTgzNjg5IDcyOTA1OTAyOTY4MjU5MA==