From 9e790feeae9ca1718d4e700ead7ccb4ba7b0d34a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Sat, 18 Sep 2021 11:28:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- note/Route/Route.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/note/Route/Route.php b/note/Route/Route.php index 7dd3ba05..3899c197 100644 --- a/note/Route/Route.php +++ b/note/Route/Route.php @@ -5,9 +5,8 @@ namespace Annotation\Route; use Annotation\Attribute; -use Http\Handler\Abstracts\HandlerManager; -use Http\Handler\Handler; -use Http\Route\Router; +use Http\Handler\Router; +use Kiri\Kiri; #[\Attribute(\Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Route extends Attribute { @@ -33,7 +32,8 @@ use Http\Route\Router; */ public function execute(mixed $class, mixed $method = null): bool { - HandlerManager::add($this->uri, $this->method, new Handler($this->uri, [$class, $method])); + $di = Kiri::getDi()->get(Router::class); + $di->addRoute($method, $this->uri, $class . '@' . $method); return parent::execute($class, $method); }