change container to php-di

This commit is contained in:
sunxyw
2022-12-25 17:42:32 +08:00
parent 60ce722010
commit 05b3446f59
23 changed files with 280 additions and 1218 deletions

View File

@@ -94,7 +94,9 @@ class MiddlewareHandler
}
}
if ($return !== false) {
$result = container()->call($callback, $args);
// 也许我们不需要显式传入参数,而是绑定到容器后自动解析,这样可以避免参数不匹配的问题
$result = container()->call($callback);
// $result = container()->call($callback, $args);
}
while (isset($this->stack[$stack_id]) && ($item = array_pop($this->stack[$stack_id])) !== null) {
// 如果是 pipeline 形式的中间件,则使用闭包回去