From a8eeff3fcc3701042fde72d51c99fcdcab176d83 Mon Sep 17 00:00:00 2001 From: Julian Krzefski Date: Fri, 2 Sep 2022 18:33:03 +0200 Subject: [PATCH] Allow auto-wiring container-parameters without using factory-callback --- src/Container.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);