diff --git a/System/Di/Container.php b/System/Di/Container.php index d3980a98..071aac65 100644 --- a/System/Di/Container.php +++ b/System/Di/Container.php @@ -103,12 +103,12 @@ class Container extends BaseObject if (!$reflect->isInstantiable()) { throw new NotFindClassException($reflect->getName()); } + $this->_param[$class] = $config; $dependencies = $this->_constructs[$class] ?? []; if (empty($config)) { return $reflect->newInstanceArgs($dependencies); } - $this->_param[$class] = $config; if (!empty($dependencies) && $reflect->implementsInterface('Snowflake\Abstracts\Configure')) { $dependencies[count($dependencies) - 1] = $config;