From 04f031a5e82d2501a7b6d1cdd7f302ebaa9f90f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 22 Feb 2021 19:11:34 +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/Snowflake.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/System/Snowflake.php b/System/Snowflake.php index 515eb30f..db5964b2 100644 --- a/System/Snowflake.php +++ b/System/Snowflake.php @@ -90,6 +90,9 @@ class Snowflake */ public static function createObject($className, $construct = []): mixed { + if (is_object($className)) { + return $className; + } if (is_string($className)) { return static::$container->get($className, $construct); } else if (is_array($className)) { @@ -273,7 +276,6 @@ class Snowflake } - /** * @param string $class * @param array $params