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:----ZOsidwPjxjY281HhNkV65hjvmSqbF+Hf6EsebbJKrPP0Fo9YvlGVom4bByE8HIZcHm/z5ACtzT78bAxDmolI5dRqHOHs9JBtBf8fVBo/ALIDGn4u7lKKgLa9g5rOwSYgWzJAuiRZg8Txiuvn/NsecToPZAm7kG/fi8r349VNkACpntZByBh1OeVbVzCC3N8yB+ve7kYyFtYQwwPFVJUoUo/SfpYAR5GCwk/EQotYbnz8W/77AzqMa3Rqsrj+FlcdgL+Ya6ToZHEBcgeQC2E3xHIvIKikmZVm9w0OpM3fzMre8pwOUC6YhDmNq2pxrN5ILbfvCdxM8HzPAPBWVjZrGZA6mK5FQfiiqqxok+9/3eBNUoPm2hOtm/RCmP45Sl8I2FH0ReBiPdSlTJK1A/I+aKKkCGUyDXAf97xWAC8dGWePKiQNY9OaQgLxWBbGZ7rDAQp6Him3tJvAmdKsKZxhLPPaPZuuYIQmPXQcdCgKHEQ+sq2GUGc2/bWPBeGspJgvJCHnWupEVAG4o1/uEv0najGeDzXBpCqOCPUGEXrcBEibnfbdFaNSNuH4LsoekuVfYjky87R75+hXDqbSUqoSUXPel9nyXWlMsO1ZwhwhQMFZhkvc/iZeStmNGtchobpnxUSnOp2aScgEw8zsCaCPQXMISeNFJbBbtnqv0AmcW4c=----ATTACHMENT:----MTczMTQ2MzA5MTA3NDYyOCA0OTc3NjMxNDcwNDE2NzQxIDI5ODU2MjE5NzgwMTA2NjQ=