This commit is contained in:
2023-12-03 01:26:55 +08:00
parent b7687f8a79
commit 6b66be1499
3 changed files with 24 additions and 3 deletions
+4 -1
View File
@@ -15,6 +15,7 @@ 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;
@@ -78,13 +79,15 @@ class RouterCollector implements \ArrayAccess, \IteratorAggregate
/**
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
* @throws ReflectionException
*/
public function __construct()
{
$found = di(NotFoundController::class);
$reflection = new \ReflectionMethod($found, 'fail');
$reflection = new ReflectionMethod($found, 'fail');
$this->found = new Handler([$found, 'fail'], [], $reflection->getReturnType());
}