From 7a4aa11b2531c8bcde975df0fdea5efe668fd005 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Sun, 16 Apr 2023 02:58:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ControllerInterpreter.php | 2 +- src/RouterCollector.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ControllerInterpreter.php b/src/ControllerInterpreter.php index 92f6945..34a74ce 100644 --- a/src/ControllerInterpreter.php +++ b/src/ControllerInterpreter.php @@ -72,7 +72,7 @@ class ControllerInterpreter $container = \Kiri::getDi(); $parameters = $container->getMethodParams($reflectionMethod); - return new Handler([$reflectionClass->getName(), $reflectionMethod->getName()], $parameters); + return new Handler([$container->get($reflectionClass->getName()), $reflectionMethod->getName()], $parameters); } } diff --git a/src/RouterCollector.php b/src/RouterCollector.php index 7d7e60c..678a49d 100644 --- a/src/RouterCollector.php +++ b/src/RouterCollector.php @@ -179,10 +179,11 @@ class RouterCollector implements \ArrayAccess, \IteratorAggregate /** * @param string $path * @return Handler + * @throws ReflectionException */ private function NotFundHandler(string $path): Handler { - return new Handler([NotFoundController::class, 'fail'], []); + return new Handler([di(NotFoundController::class), 'fail'], []); } /**