This commit is contained in:
2021-09-18 13:45:33 +08:00
parent c5afc4647e
commit a6f056b8c8
2 changed files with 25 additions and 3 deletions
+19 -2
View File
@@ -19,12 +19,29 @@ abstract class Handler implements RequestHandlerInterface
private int $offset = 0;
protected CHl $handler;
protected ?array $middlewares;
/**
* @param CHl $handler
* @param array|null $middlewares
* @return $this
*/
public function __construct(protected CHl $handler, protected ?array $middlewares)
public function setHandler(CHl $handler): static
{
$this->handler = $handler;
return $this;
}
/**
* @param array|null $middlewares
* @return $this
*/
public function setMiddlewares(?array $middlewares): static
{
$this->middlewares = $middlewares;
return $this;
}