Exemple #1
0
 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;
 }
Exemple #2
0
 public function compile(RouteCompiler $compiler) : array
 {
     return [$compiler->compile($this->pattern . '{K1MOUNT}', $this)];
 }