Commit e4641d41 authored by Fabien Potencier's avatar Fabien Potencier

made the code more readable

parent c89133e8
......@@ -370,7 +370,9 @@ class Application extends \Pimple implements HttpKernelInterface, EventSubscribe
$result = call_user_func($callback, $exception, $code);
if (null !== $result) {
$event->setResponse($result instanceof Response ? $result : new Response((string) $result));
$response = $result instanceof Response ? $result : new Response((string) $result);
$event->setResponse($response);
}
}, $priority);
}
......@@ -567,8 +569,9 @@ class Application extends \Pimple implements HttpKernelInterface, EventSubscribe
public function onKernelView(GetResponseForControllerResultEvent $event)
{
$response = $event->getControllerResult();
$response = $response instanceof Response ? $response : new Response((string) $response);
$event->setResponse($response instanceof Response ? $response : new Response((string) $response));
$event->setResponse($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