diff --git a/src/Container.php b/src/Container.php index 7c4521b..4ccb4a3 100644 --- a/src/Container.php +++ b/src/Container.php @@ -206,7 +206,7 @@ private function loadObject(string $name, int $depth = 64) /*: object (PHP 7.2+) // build list of constructor parameters based on parameter types $ctor = $class->getConstructor(); - $params = $ctor === null ? [] : $this->loadFunctionParams($ctor, $depth, false); + $params = $ctor === null ? [] : $this->loadFunctionParams($ctor, $depth, true); // instantiate with list of parameters return $this->container[$name] = $params === [] ? new $name() : $class->newInstance(...$params);