From 3a82902aaabbae7e774b3a57b0aed4165749a67c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 29 Mar 2021 17:10:31 +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/BaseObject.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/System/Abstracts/BaseObject.php b/System/Abstracts/BaseObject.php index 6a5fd4eb..1843de40 100644 --- a/System/Abstracts/BaseObject.php +++ b/System/Abstracts/BaseObject.php @@ -12,6 +12,7 @@ namespace Snowflake\Abstracts; use Exception; use JetBrains\PhpStorm\Pure; +use Snowflake\Application; use Snowflake\Snowflake; use Swoole\Coroutine; @@ -35,9 +36,8 @@ class BaseObject implements Configure if (!empty($config) && is_array($config)) { Snowflake::configure($this, $config); } - $app = Snowflake::app(); - if ($app != null && $app->has('attributes')) { + if ($app instanceof Application && $app->has('attributes')) { annotation()->injectProperty($this); } $this->initialization();