From b42be92f195417ec8bce6e8ed83defebc6b4f0b8 Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Mon, 9 Aug 2021 02:01:16 +0800 Subject: [PATCH] modify --- System/Snowflake.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/System/Snowflake.php b/System/Snowflake.php index 8be2e0a4..49961c3b 100644 --- a/System/Snowflake.php +++ b/System/Snowflake.php @@ -188,9 +188,7 @@ class Snowflake */ public static function createObject($className, array $construct = []): mixed { - if (is_callable($className, TRUE)) { - return call_user_func($className, $construct); - } else if (is_string($className) && class_exists($className)) { + if (is_string($className) && class_exists($className)) { return static::$container->get($className, $construct); } else if (is_array($className) && isset($class['class'])) { $class = $className['class']; @@ -198,8 +196,6 @@ class Snowflake return static::$container->newObject($class, $construct, $className); } else if (is_callable($className, TRUE)) { return call_user_func($className, $construct); - } else if (is_callable($className, TRUE)) { - return call_user_func($className, $construct); } else { throw new Exception('Unsupported configuration type: ' . gettype($className)); }