In Route::finalize(), rather than getting the Group's middleware and adding it to the MiddlwareDispatcher, maybe we should call $group->addToMiddlewareDipatcher($this->middlewareDispatcher) which does the foreach over the middleware. This removes RouteGroup::getMiddleware() which feels like an encapsulation leakage.
In Route::finalize(), rather than getting the Group's middleware and adding it to the MiddlwareDispatcher, maybe we should call $group->addToMiddlewareDipatcher($this->middlewareDispatcher) which does the foreach over the middleware. This removes RouteGroup::getMiddleware() which feels like an encapsulation leakage.