protected $dispatcher;
protected $resolver;
protected $requestStack;
private ArgumentResolverInterface
$argumentResolver;
private bool
$handleAllThrowables;
public function __construct(EventDispatcherInterface
$dispatcher, ControllerResolverInterface
$resolver, RequestStack
$requestStack = null, ArgumentResolverInterface
$argumentResolver = null, bool
$handleAllThrowables = false
) { $this->dispatcher =
$dispatcher;
$this->resolver =
$resolver;
$this->requestStack =
$requestStack ??
new RequestStack();
$this->argumentResolver =
$argumentResolver ??
new ArgumentResolver();
$this->handleAllThrowables =
$handleAllThrowables;
} public function handle(Request
$request, int
$type = HttpKernelInterface::MAIN_REQUEST, bool
$catch = true
): Response
{ $request->headers->
set('X-Php-Ob-Level',
(string) ob_get_level());
$this->requestStack->
push($request);
$response = null;
try { return $response =
$this->
handleRaw($request,
$type);
}