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)); }