Skip to content
Snippets Groups Projects
Commit 763da425 authored by Bernhard Posselt's avatar Bernhard Posselt
Browse files

fix the middleware registration process in the container

parent 2fc6fb36
No related branches found
No related tags found
No related merge requests found
......@@ -92,12 +92,11 @@ class DIContainer extends SimpleContainer implements IAppContainer{
return new SecurityMiddleware($app, $c['Request']);
});
$middleWares = $this->middleWares;
$this['MiddlewareDispatcher'] = $this->share(function($c) use ($middleWares) {
$this['MiddlewareDispatcher'] = $this->share(function($c) {
$dispatcher = new MiddlewareDispatcher();
$dispatcher->registerMiddleware($c['SecurityMiddleware']);
foreach($middleWares as $middleWare) {
foreach($this->middleWares as $middleWare) {
$dispatcher->registerMiddleware($c[$middleWare]);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment