From b90967dc29e2a7baf13ef72e01e29b4cbe8a7ec4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Wed, 3 Mar 2021 19:13:29 +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/Node.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/HttpServer/Route/Node.php b/HttpServer/Route/Node.php index ba20ae0f..99dc7a8e 100644 --- a/HttpServer/Route/Node.php +++ b/HttpServer/Route/Node.php @@ -397,7 +397,11 @@ class Node extends HttpService return $this; } } - if (!is_array($class) || is_object($class[0])) { + if (is_array($class)) { + if (isset($class[0]) && is_object($class[0])) { + $class = [$class]; + } + } else { $class = [$class]; } foreach ($class as $closure) {