Aggiornato Composer

This commit is contained in:
Paolo A
2024-05-17 12:24:19 +00:00
parent 4ac62108b5
commit ec201d75b2
2238 changed files with 38684 additions and 59785 deletions

View File

@@ -55,7 +55,7 @@ class HttpKernel implements HttpKernelInterface, TerminableInterface
protected $requestStack;
private $argumentResolver;
public function __construct(EventDispatcherInterface $dispatcher, ControllerResolverInterface $resolver, RequestStack $requestStack = null, ArgumentResolverInterface $argumentResolver = null)
public function __construct(EventDispatcherInterface $dispatcher, ControllerResolverInterface $resolver, ?RequestStack $requestStack = null, ?ArgumentResolverInterface $argumentResolver = null)
{
$this->dispatcher = $dispatcher;
$this->resolver = $resolver;
@@ -70,6 +70,7 @@ class HttpKernel implements HttpKernelInterface, TerminableInterface
{
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
$this->requestStack->push($request);
try {
return $this->handleRaw($request, $type);
} catch (\Exception $e) {
@@ -83,6 +84,8 @@ class HttpKernel implements HttpKernelInterface, TerminableInterface
}
return $this->handleThrowable($e, $request, $type);
} finally {
$this->requestStack->pop();
}
}
@@ -97,13 +100,23 @@ class HttpKernel implements HttpKernelInterface, TerminableInterface
/**
* @internal
*/
public function terminateWithException(\Throwable $exception, Request $request = null)
public function terminateWithException(\Throwable $exception, ?Request $request = null)
{
if (!$request = $request ?: $this->requestStack->getMainRequest()) {
throw $exception;
}
$response = $this->handleThrowable($exception, $request, self::MAIN_REQUEST);
if ($pop = $request !== $this->requestStack->getMainRequest()) {
$this->requestStack->push($request);
}
try {
$response = $this->handleThrowable($exception, $request, self::MAIN_REQUEST);
} finally {
if ($pop) {
$this->requestStack->pop();
}
}
$response->sendHeaders();
$response->sendContent();
@@ -121,8 +134,6 @@ class HttpKernel implements HttpKernelInterface, TerminableInterface
*/
private function handleRaw(Request $request, int $type = self::MAIN_REQUEST): Response
{
$this->requestStack->push($request);
// request
$event = new RequestEvent($this, $request, $type);
$this->dispatcher->dispatch($event, KernelEvents::REQUEST);
@@ -199,7 +210,6 @@ class HttpKernel implements HttpKernelInterface, TerminableInterface
private function finishRequest(Request $request, int $type)
{
$this->dispatcher->dispatch(new FinishRequestEvent($this, $request, $type), KernelEvents::FINISH_REQUEST);
$this->requestStack->pop();
}
/**