diff --git a/src/RouterCollector.php b/src/RouterCollector.php index 968f65f..96ac679 100644 --- a/src/RouterCollector.php +++ b/src/RouterCollector.php @@ -6,19 +6,16 @@ namespace Kiri\Router; use Closure; -use Exception; use Kiri; use Kiri\Router\Base\NotFoundController; use Kiri\Router\Constrict\RequestMethod; use Kiri\Di\Inject\Container; -use Psr\Container\ContainerExceptionInterface; use Psr\Container\ContainerInterface; -use Psr\Container\NotFoundExceptionInterface; -use ReflectionException; use ReflectionMethod; use Throwable; use Traversable; use Kiri\Router\Base\Middleware; +use Kiri\Router\Format\ResponseFormat; /** @@ -58,12 +55,6 @@ class RouterCollector implements \ArrayAccess, \IteratorAggregate protected array $httpHandler = []; - /** - * @var array - */ - protected array $controllers = []; - - /** * @var Handler */ @@ -91,8 +82,7 @@ class RouterCollector implements \ArrayAccess, \IteratorAggregate { $found = di(NotFoundController::class); - $reflection = new ReflectionMethod($found, 'fail'); - $this->found = new Handler([$found, 'fail'], $reflection); + $this->found = new Handler([$found, 'fail'], [], ResponseFormat::class); }