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:----VJ/jVeyObK3902DOQiI7vR7r2Js5jVQoPIEjY9p3vhxY1G1ynBaJTSL3YSlYl8hMoaeHilSGIr+pg8fvKC5n2aZYPvbxbvjNwgd+xvERp9+Y8q1iBYBecJWkV1qinYtLvfFxNg8CtR1l5wwc1N4+3Q01n8C2TQbMHNhG+M049rio8eYfPbHybSN21C7meEwqHWKXD/9284S+ikdO6VBgsW0Kk2ktEPxfRtzBQX5Dij8OZxfytQiRu8Bf/kN5NZXl4WVdpUY2baS72u+XbKN+F+uVoOoHYJYjnplQrehTUnBQJuHIpLXxQD9RfXVQjDe0/hiW/7w01VS93hGa+KmMd4Sir86cX0vZFKmLYG8ot/ZC3mKEM3UYCPaVW/06niEAZNZ2UzE6aHwdII7XDkbOH4XpYBaO5WoHbKBkTHdYyBWsku/0XusLBwkiR9NdfB0LLrrT5BogOwHSOBLVwpcBtJjopO/mypCwC2Gvgtfx5CM3dyfX2Zrqb3RVr7uJ09UBv/1qTKOO2rwIxZtfbCyfEfE0FEiDF/vFYQTW2TdzNLA0J2echiK+k6HqpBdc9PT5p5b+5SQdZ2o2Atkw7jDI2WJ325VwTU/WMETSbJoASBUoFTK1pfXawc9LBYU/FJLYyW+fuC5tZt9/eeqitfrpm6fa8J/YGTYQarBgux3I4U0=----ATTACHMENT:----NDgzNTIyNzQwMDMyODQwMiA1MDQyOTQxODQ4MjgyMDAxIDQ1MjMzNjEwNTU4MTE1Mw==