From d35bf876425eba47ae3a7027d13fefc0def35ef5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 2 Nov 2020 15:07:58 +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 --- HttpServer/Route/Annotation/Annotation.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/HttpServer/Route/Annotation/Annotation.php b/HttpServer/Route/Annotation/Annotation.php index b33d152d..7e76d896 100644 --- a/HttpServer/Route/Annotation/Annotation.php +++ b/HttpServer/Route/Annotation/Annotation.php @@ -242,12 +242,16 @@ class Annotation extends \Snowflake\Annotation\Annotation /** * @param $name - * @param $events + * @param $comment * @return false|string */ - public function getName($name, $events) + public function getName($name, $comment) { - return self::HTTP_EVENT . $name . ':' . $events[2]; + $prefix = self::HTTP_EVENT . ltrim($name, ':'); + if (isset($comment[2]) && !empty($comment[2])) { + return $prefix . ':' . $comment[2]; + } + return $prefix; } }