Upgrade 1-11.38

This commit is contained in:
xesmyd
2026-03-30 14:10:30 +02:00
parent f2a7e6d1fc
commit ac648ef29d
24665 changed files with 69682 additions and 2205004 deletions
+7 -11
View File
@@ -11,9 +11,9 @@
namespace Symfony\Component\HttpKernel\Fragment;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\StreamedResponse;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpKernel\Controller\ControllerReference;
/**
@@ -29,17 +29,15 @@ use Symfony\Component\HttpKernel\Controller\ControllerReference;
class FragmentHandler
{
private $debug;
private $renderers = array();
private $renderers = [];
private $requestStack;
/**
* Constructor.
*
* @param RequestStack $requestStack The Request stack that controls the lifecycle of requests
* @param FragmentRendererInterface[] $renderers An array of FragmentRendererInterface instances
* @param bool $debug Whether the debug mode is enabled or not
*/
public function __construct(RequestStack $requestStack, array $renderers = array(), $debug = false)
public function __construct(RequestStack $requestStack, array $renderers = [], $debug = false)
{
$this->requestStack = $requestStack;
foreach ($renderers as $renderer) {
@@ -50,8 +48,6 @@ class FragmentHandler
/**
* Adds a renderer.
*
* @param FragmentRendererInterface $renderer A FragmentRendererInterface instance
*/
public function addRenderer(FragmentRendererInterface $renderer)
{
@@ -74,7 +70,7 @@ class FragmentHandler
* @throws \InvalidArgumentException when the renderer does not exist
* @throws \LogicException when no master request is being handled
*/
public function render($uri, $renderer = 'inline', array $options = array())
public function render($uri, $renderer = 'inline', array $options = [])
{
if (!isset($options['ignore_errors'])) {
$options['ignore_errors'] = !$this->debug;
@@ -97,8 +93,6 @@ class FragmentHandler
* When the Response is a StreamedResponse, the content is streamed immediately
* instead of being returned.
*
* @param Response $response A Response instance
*
* @return string|null The Response content or null when the Response is streamed
*
* @throws \RuntimeException when the Response is not successful
@@ -106,7 +100,7 @@ class FragmentHandler
protected function deliver(Response $response)
{
if (!$response->isSuccessful()) {
throw new \RuntimeException(sprintf('Error when rendering "%s" (Status code is %s).', $this->requestStack->getCurrentRequest()->getUri(), $response->getStatusCode()));
throw new \RuntimeException(sprintf('Error when rendering "%s" (Status code is %d).', $this->requestStack->getCurrentRequest()->getUri(), $response->getStatusCode()));
}
if (!$response instanceof StreamedResponse) {
@@ -114,5 +108,7 @@ class FragmentHandler
}
$response->sendContent();
return null;
}
}