diff --git a/Container.php b/Container.php index 2f46419..6df0bea 100644 --- a/Container.php +++ b/Container.php @@ -168,7 +168,7 @@ class Container implements ContainerInterface } if (($handler = $reflect->getConstructor()) !== null) { - $construct = $this->getMethodParams($handler); + $construct = $this->mergeParams($this->getMethodParams($handler), $construct); } $newInstance = $reflect->newInstanceArgs($construct); @@ -211,7 +211,7 @@ class Container implements ContainerInterface throw new ReflectionException('Class ' . $reflect->getName() . ' cannot be instantiated'); } - if (empty($construct) && ($handler = $reflect->getConstructor()) !== null) { + if (($handler = $reflect->getConstructor()) !== null) { $construct = $this->getMethodParams($handler); } $newInstance = $reflect->newInstanceArgs($construct);