public function compile(RouteCompiler $compiler) : array { $compiled = []; if ($this->handlers) { foreach ($this->handlers as $handler) { $compiled[] = $compiler->compile($this->pattern, $handler); } } else { $compiled[] = $compiler->compile($this->pattern, new RouteHandler(function () { return (new HttpResponse())->withStatus(Http::SERVICE_UNAVAILABLE, 'No route handler defined'); })); } return $compiled; }
public function compile(RouteCompiler $compiler) : array { return [$compiler->compile($this->pattern . '{K1MOUNT}', $this)]; }