eee
This commit is contained in:
+1
-17
@@ -177,22 +177,6 @@ class Container implements ContainerInterface
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $default
|
||||
* @param array $params
|
||||
* @return array
|
||||
*/
|
||||
protected function mergeParams(array $default, array $params): array
|
||||
{
|
||||
if (empty($params)) {
|
||||
return $default;
|
||||
}
|
||||
foreach ($params as $key => $value) {
|
||||
$default[$key] = $value;
|
||||
}
|
||||
return $default;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param ReflectionClass $reflect
|
||||
@@ -211,7 +195,7 @@ class Container implements ContainerInterface
|
||||
throw new ReflectionException('Class ' . $reflect->getName() . ' cannot be instantiated');
|
||||
}
|
||||
|
||||
if (($handler = $reflect->getConstructor()) !== null) {
|
||||
if (empty($construct) && ($handler = $reflect->getConstructor()) !== null) {
|
||||
$construct = $this->getMethodParams($handler);
|
||||
}
|
||||
$newInstance = $reflect->newInstanceArgs($construct);
|
||||
|
||||
Reference in New Issue
Block a user