Commit 63e24c54 authored by Fabien Potencier's avatar Fabien Potencier

added the application as a third argument to the after middleware (to be...

added the application as a third argument to the after middleware (to be consistent with the before one)

This is mainly useful when working with Traits.
parent 09a61047
...@@ -76,7 +76,7 @@ class MiddlewareListener implements EventSubscriberInterface ...@@ -76,7 +76,7 @@ class MiddlewareListener implements EventSubscriberInterface
} }
foreach ((array) $route->getOption('_after_middlewares') as $callback) { foreach ((array) $route->getOption('_after_middlewares') as $callback) {
$response = call_user_func($callback, $request, $event->getResponse()); $response = call_user_func($callback, $request, $event->getResponse(), $this->app);
if ($response instanceof Response) { if ($response instanceof Response) {
$event->setResponse($response); $event->setResponse($response);
} elseif (null !== $response) { } elseif (null !== $response) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment