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:----qDOsK7McRnxWul66LyM21H1Lw2pgpqTNNeG0K2mmXx1Xm+PY7VDgkgLHNkKaxO9+4YynxFI+4NPs/jKRx0NDRgPGwuhTfn3mbw2LEXCvb7/M62dr8ZGShbTSrbqpueS2A8vrvI8vwGcxnHOmpmZc74cvvRSlmlBmm/iF6Kmvnjq6rZ/fEMYsxykg10w3EqqJZArJoRBJsy6AHQUkOt7AjtdlXzIt0JVITFZX4livisuCXoY5bhq4BB3QoDoc9e/5qGVxCo7YrL0sApuiFBzDpX8jOO6rwhCOA1WUf4jhNsr8iIJrz6yoBoj6BuWZbDQ+pcKivyW3+ROcGyU/krr5w+iHXGyvalxnEAzvYsgNpVXTkXK9Vc1rxKlv9pmOIE5UHuu54Ppa1nKS+3ZIdlBacfhEwgo0jQoxgEvjCl++jHLEIKZBNKr+Csq0HIJfNhRW7Gj9XTqxJRJzumyngoBqGr5Hn87zbCoGy6UCQEq7P+fTJdeY4gR5bInkh0BIU1Qv9+VNDnvsqKSRyBg+ZCv2LRkeDDqVh1Yp4rx3V+TgyZIMqaLUVmjij6bz8hju0f262svuszCa9QzPyz5bhkZdX7Vo0MlDvgCsN94yLRPYwfcjJl0OUqnvm5+qNdSjVahCkDCWQjz1ZZdoJw+jmHiMg1Moxiq+0pwWpy3Wk0JXUBA=----ATTACHMENT:----NTk2MDEyMzcyMTY0NDEzNSA2MjM2NzY4NDg1MjgzODIyIDgyNTk3MTAzNDQyMDY4MjE=