From dc1ce501378e658d3a8451b684d94409cdb825f2 Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Tue, 23 Feb 2021 02:05:21 +0800 Subject: [PATCH] modify --- System/Di/Container.php | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/System/Di/Container.php b/System/Di/Container.php index 1961f268..6e962c3a 100644 --- a/System/Di/Container.php +++ b/System/Di/Container.php @@ -97,10 +97,6 @@ class Container extends BaseObject throw new NotFindClassException($reflect->getName()); } - if ($class == HttpHeaders::class) { - var_dump($class); - } - $dependencies = $this->_constructs[$class] ?? []; if (empty($config)) { return $reflect->newInstanceArgs($dependencies); @@ -147,14 +143,15 @@ class Container extends BaseObject $reflection = $this->_reflection[$class]; } -// if (!is_null($construct = $reflection->getConstructor())) { -// $this->_constructs[$class] = $this->resolveMethodParam($construct, $constrict); -// } else { -// if ($class == HttpHeaders::class) { -// var_dump($constrict); -// } -// $this->_constructs[$class] = $constrict; -// } + if (!is_null($construct = $reflection->getConstructor())) { + $this->_constructs[$class] = $this->resolveMethodParam($construct, $constrict); + } else { + $this->_constructs[$class] = $constrict; + } + + if ($class == HttpHeaders::class) { + var_dump($constrict, $this->_constructs[$class]); + } return $reflection; }