eee
This commit is contained in:
+7
-2
@@ -7,6 +7,7 @@ use Closure;
|
||||
use Kiri\Router\Format\ArrayFormat;
|
||||
use Kiri\Router\Format\IFormat;
|
||||
use Kiri\Router\Format\MixedFormat;
|
||||
use Kiri\Router\Format\NoBody;
|
||||
use Kiri\Router\Format\OtherFormat;
|
||||
use Kiri\Router\Format\ResponseFormat;
|
||||
use Kiri\Router\Format\VoidFormat;
|
||||
@@ -36,13 +37,14 @@ class Handler implements RequestHandlerInterface
|
||||
|
||||
/**
|
||||
* @param array|Closure $handler
|
||||
* @param string $method
|
||||
* @param array $parameter
|
||||
* @param ReflectionNamedType|null $reflectionType
|
||||
* @throws ReflectionException
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
public function __construct(public array|Closure $handler, public array $parameter, public ?ReflectionNamedType $reflectionType)
|
||||
public function __construct(public array|Closure $handler, string $method, public array $parameter, public ?ReflectionNamedType $reflectionType)
|
||||
{
|
||||
$this->container = \Kiri::getDi();
|
||||
if ($this->reflectionType != null) {
|
||||
@@ -50,6 +52,9 @@ class Handler implements RequestHandlerInterface
|
||||
} else {
|
||||
$this->format = $this->container->get(MixedFormat::class);
|
||||
}
|
||||
if ($method === 'HEAD') {
|
||||
$this->format = $this->container->get(NoBody::class);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user