mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-12-15 11:23:47 +09:00
Updates to vendors etc
This commit is contained in:
30
vendor/symfony/http-kernel/HttpKernelBrowser.php
vendored
30
vendor/symfony/http-kernel/HttpKernelBrowser.php
vendored
@@ -25,21 +25,22 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* @method Request getRequest()
|
||||
* @method Response getResponse()
|
||||
* @template-extends AbstractBrowser<Request, Response>
|
||||
*/
|
||||
class HttpKernelBrowser extends AbstractBrowser
|
||||
{
|
||||
protected $kernel;
|
||||
private bool $catchExceptions = true;
|
||||
|
||||
/**
|
||||
* @param array $server The server parameters (equivalent of $_SERVER)
|
||||
*/
|
||||
public function __construct(HttpKernelInterface $kernel, array $server = [], ?History $history = null, ?CookieJar $cookieJar = null)
|
||||
{
|
||||
public function __construct(
|
||||
protected HttpKernelInterface $kernel,
|
||||
array $server = [],
|
||||
?History $history = null,
|
||||
?CookieJar $cookieJar = null,
|
||||
) {
|
||||
// These class properties must be set before calling the parent constructor, as it may depend on it.
|
||||
$this->kernel = $kernel;
|
||||
$this->followRedirects = false;
|
||||
|
||||
parent::__construct($server, $history, $cookieJar);
|
||||
@@ -47,20 +48,16 @@ class HttpKernelBrowser extends AbstractBrowser
|
||||
|
||||
/**
|
||||
* Sets whether to catch exceptions when the kernel is handling a request.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function catchExceptions(bool $catchExceptions)
|
||||
public function catchExceptions(bool $catchExceptions): void
|
||||
{
|
||||
$this->catchExceptions = $catchExceptions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
protected function doRequest(object $request)
|
||||
protected function doRequest(object $request): Response
|
||||
{
|
||||
$response = $this->kernel->handle($request, HttpKernelInterface::MAIN_REQUEST, $this->catchExceptions);
|
||||
|
||||
@@ -73,10 +70,8 @@ class HttpKernelBrowser extends AbstractBrowser
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function getScript(object $request)
|
||||
protected function getScript(object $request): string
|
||||
{
|
||||
$kernel = var_export(serialize($this->kernel), true);
|
||||
$request = var_export(serialize($request), true);
|
||||
@@ -112,10 +107,7 @@ EOF;
|
||||
return $code.$this->getHandleScript();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function getHandleScript()
|
||||
protected function getHandleScript(): string
|
||||
{
|
||||
return <<<'EOF'
|
||||
$response = $kernel->handle($request);
|
||||
|
||||
Reference in New Issue
Block a user