This commit is contained in:
2023-04-16 12:44:43 +08:00
parent 218fd19135
commit 9f5afeab54
8 changed files with 118 additions and 41 deletions
+33
View File
@@ -21,6 +21,39 @@ class Handler implements RequestHandlerInterface
}
/**
* @return bool
*/
public function isClosure(): bool
{
return $this->handler instanceof \Closure;
}
/**
* @return string|null
*/
public function getClass(): ?string
{
if ($this->isClosure()) {
return null;
}
return $this->handler[0]::class;
}
/**
* @return string|null
*/
public function getMethod(): ?string
{
if ($this->isClosure()) {
return null;
}
return $this->handler[1];
}
/**
* @param ServerRequestInterface $request
* @return ResponseInterface