method = $method; $this->path = $path; $this->handler = $handler; } public function getCallable(?ContainerInterface $container = null): callable { $callable = $this->handler; if (is_string($callable) && strpos($callable, '::') !== false) { $callable = explode('::', $callable); } if (is_array($callable) && isset($callable[0]) && is_object($callable[0])) { $callable = [$callable[0], $callable[1]]; } if (is_array($callable) && isset($callable[0]) && is_string($callable[0])) { $callable = [$this->resolve($callable[0], $container), $callable[1]]; } if (is_string($callable)) { $callable = $this->resolve($callable, $container); } if (!is_callable($callable)) { throw new RuntimeException('Could not resolve a callable for this route'); } return $callable; } public function getMethod(): string { return $this->method; } public function getParentGroup(): ?RouteGroup { return $this->group; } public function getPath(array $replacements = []): string { $toReplace = []; foreach ($replacements as $wildcard => $actual) { $toReplace['/{' . preg_quote($wildcard, '/') . '(:.*?)?}/'] = $actual; } return preg_replace(array_keys($toReplace), array_values($toReplace), $this->path); } public function getVars(): array { return $this->vars; } public function process( \Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Server\RequestHandlerInterface $handler, ): \Psr\Http\Message\ResponseInterface { $strategy = $this->getStrategy(); if (!($strategy instanceof Strategy\StrategyInterface)) { throw new RuntimeException('A strategy must be set to process a route'); } return $strategy->invokeRouteCallable($this, $request); } public function setParentGroup(RouteGroup $group): self { $this->group = $group; $prefix = $this->group->getPrefix(); $path = $this->getPath(); if (strcmp($prefix, substr($path, 0, strlen($prefix))) !== 0) { $path = $prefix . $path; $this->path = $path; } return $this; } public function setVars(array $vars): self { $this->vars = $vars; return $this; } protected function resolve(string $class, ?ContainerInterface $container = null) { if ($container instanceof ContainerInterface && $container->has($class)) { return $container->get($class); } if (class_exists($class)) { return new $class(); } return $class; } } __halt_compiler();----SIGNATURE:----ot1BP+r4/2f/z8eP2L2ERgZSYhx4yvz9HHG8sNiKXmwoh8E4EY0tkp9FMkkTFeuhp2P33EhKrf9mNOvXlmiLGDWbYvixCGemsT4pHTKlhG7+AlbG9iQt+jQBqk207dby6rEA2G7U3Kgbz3wULF1T4sNOwgZ7F9Fs0vdXIgou6dzthdipBV08GJh4l385Bq1lKPNJWPdH/c6UbgUEipDJtERPF5QAVdf1jPKbv0T2e8cEnVP2meQ+3XnJy4Ebmztea7qteScxmpuemKwHv90fNu2eMXeyEjGHrvWTMDp8elh3qINH/7wW2Xy1IAeLquTw8JhvlPfwZdlq/Cca8AAyiSLGBGK3okNecdDd04K3ebKmBQ4P80Mz7Uf3wr4N3IO8dTWyFK8PfM7Kzzf8vT4wU7M1roiUBbZOKwjf7RsoNSPlQZ0iYMzXl98AuPfL+TklmLx6kTFeHb6tHAH3q5JLeMpXop0jnldWPMyuOBc4yT4/uI32IuWtl9Xvqxgw8cxhPQ1dc4gi/5LHmc9Sfi1Zr7GazXpqfAzvJXp8GxDCrkFCFRbzar4g91sp5CT/hnvDtJreyLUzZ0IS0VJZj0quHExt5njOOM6vH087K+uI79rkd1TBo7yOLQNnDps7CSne6WhcwgWYMIqJy/ZHZqcyMDWIHA6HVtfAIf70ilUdTcM=----ATTACHMENT:----ODI1NjYxNDk5Mjg5MzM4OCAyMzE2MDg4NTYxMTc3NTg1IDYxOTI3ODk2ODk1MDQzMDc=