源码在make Kernel类时 是通过反射的方式去实例化,在调用构造函数时 :
public function __construct(Application $app, Router $router)
{
$this->app = $app;
$this->router = $router;
foreach ($this->middlewareGroups as $key => $middleware) {
$router->middlewareGroup($key, $middleware);
}
foreach ($this->routeMiddleware as $key => $middleware) {
$router->middleware($key, $middleware);
}
}
为什么$this->middlewareGroups已经有内容了 是在何时赋值的?