From 1d265d6f7f0c2edc756a10dbac055337419926ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 23 Mar 2021 19:11:33 +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 --- System/Abstracts/BaseApplication.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/System/Abstracts/BaseApplication.php b/System/Abstracts/BaseApplication.php index 23719c97..e0e07ced 100644 --- a/System/Abstracts/BaseApplication.php +++ b/System/Abstracts/BaseApplication.php @@ -182,12 +182,9 @@ abstract class BaseApplication extends Service $event = Snowflake::app()->getEvent(); foreach ($config['events'] as $key => $value) { if (is_string($value)) { - if (!class_exists($value)) { - throw new InitException("Class {$value} does not exists."); - } $value = Snowflake::createObject($value); } - if (is_array($value) && isset($value[0]) && is_object($value[0])) { + if (is_array($value) && isset($value[0]) && !($value[0] instanceof \Closure)) { if (!is_callable($value, true)) { throw new InitException("Class does not hav callback."); }