From 8ea9cb20ab824d03fc29648591387c6585175d53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Sun, 16 Apr 2023 20:25:37 +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/Inject/Route.php | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/Inject/Route.php diff --git a/src/Inject/Route.php b/src/Inject/Route.php new file mode 100644 index 0000000..f8d4f82 --- /dev/null +++ b/src/Inject/Route.php @@ -0,0 +1,37 @@ +path); + } + + + /** + * @param object $class + * @param string $method + * @return void + * @throws \ReflectionException + */ + public function dispatch(object $class, string $method): void + { + // TODO: Implement dispatch() method. + Router::addRoute($this->method, $this->path, [$class, $method]); + + $this->registerMiddleware($class, $method); + } +}