From 489d34cbfa6dd827f81b4dac1d9b4ae24485d0b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 23 Aug 2021 19:12:15 +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 --- http-helper/Route/Node.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/http-helper/Route/Node.php b/http-helper/Route/Node.php index 79212708..069042f9 100644 --- a/http-helper/Route/Node.php +++ b/http-helper/Route/Node.php @@ -234,8 +234,12 @@ class Node { [$controller, $action] = $handler; + if (is_object($controller)) { + $controller = get_class($controller); + } + /** @var Aspect $aspect */ - $aspect = Kiri::getDi()->getMethodByAnnotation(Aspect::class, $controller::class, $action); + $aspect = Kiri::getDi()->getMethodByAnnotation(Aspect::class, $controller, $action); if (empty($aspect)) { return null; }