mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-12-02 13:09:53 +09:00
Update composer dependencies
This commit is contained in:
@@ -59,7 +59,7 @@ abstract class AbstractSurrogateFragmentRenderer extends RoutableFragmentRendere
|
||||
*
|
||||
* @see Symfony\Component\HttpKernel\HttpCache\SurrogateInterface
|
||||
*/
|
||||
public function render($uri, Request $request, array $options = array())
|
||||
public function render($uri, Request $request, array $options = [])
|
||||
{
|
||||
if (!$this->surrogate || !$this->surrogate->hasSurrogateCapability($request)) {
|
||||
if ($uri instanceof ControllerReference && $this->containsNonScalars($uri->attributes)) {
|
||||
|
||||
@@ -29,7 +29,7 @@ use Symfony\Component\HttpKernel\Controller\ControllerReference;
|
||||
class FragmentHandler
|
||||
{
|
||||
private $debug;
|
||||
private $renderers = array();
|
||||
private $renderers = [];
|
||||
private $requestStack;
|
||||
|
||||
/**
|
||||
@@ -37,7 +37,7 @@ class FragmentHandler
|
||||
* @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(), bool $debug = false)
|
||||
public function __construct(RequestStack $requestStack, array $renderers = [], bool $debug = false)
|
||||
{
|
||||
$this->requestStack = $requestStack;
|
||||
foreach ($renderers as $renderer) {
|
||||
@@ -70,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;
|
||||
|
||||
@@ -31,7 +31,7 @@ interface FragmentRendererInterface
|
||||
*
|
||||
* @return Response A Response instance
|
||||
*/
|
||||
public function render($uri, Request $request, array $options = array());
|
||||
public function render($uri, Request $request, array $options = []);
|
||||
|
||||
/**
|
||||
* Gets the name of the strategy.
|
||||
|
||||
@@ -59,6 +59,10 @@ class HIncludeFragmentRenderer extends RoutableFragmentRenderer
|
||||
throw new \InvalidArgumentException('The hinclude rendering strategy needs an instance of Twig\Environment or Symfony\Component\Templating\EngineInterface');
|
||||
}
|
||||
|
||||
if ($templating instanceof EngineInterface) {
|
||||
@trigger_error(sprintf('Using a "%s" instance for "%s" is deprecated since version 4.3; use a \Twig\Environment instance instead.', EngineInterface::class, __CLASS__), E_USER_DEPRECATED);
|
||||
}
|
||||
|
||||
$this->templating = $templating;
|
||||
}
|
||||
|
||||
@@ -81,7 +85,7 @@ class HIncludeFragmentRenderer extends RoutableFragmentRenderer
|
||||
* * id: An optional hx:include tag id attribute
|
||||
* * attributes: An optional array of hx:include tag attributes
|
||||
*/
|
||||
public function render($uri, Request $request, array $options = array())
|
||||
public function render($uri, Request $request, array $options = [])
|
||||
{
|
||||
if ($uri instanceof ControllerReference) {
|
||||
if (null === $this->signer) {
|
||||
@@ -102,7 +106,7 @@ class HIncludeFragmentRenderer extends RoutableFragmentRenderer
|
||||
$content = $template;
|
||||
}
|
||||
|
||||
$attributes = isset($options['attributes']) && \is_array($options['attributes']) ? $options['attributes'] : array();
|
||||
$attributes = isset($options['attributes']) && \is_array($options['attributes']) ? $options['attributes'] : [];
|
||||
if (isset($options['id']) && $options['id']) {
|
||||
$attributes['id'] = $options['id'];
|
||||
}
|
||||
|
||||
@@ -11,14 +11,15 @@
|
||||
|
||||
namespace Symfony\Component\HttpKernel\Fragment;
|
||||
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\Controller\ControllerReference;
|
||||
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
|
||||
use Symfony\Component\HttpKernel\Event\ExceptionEvent;
|
||||
use Symfony\Component\HttpKernel\HttpCache\SubRequestHandler;
|
||||
use Symfony\Component\HttpKernel\HttpKernelInterface;
|
||||
use Symfony\Component\HttpKernel\KernelEvents;
|
||||
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
|
||||
|
||||
/**
|
||||
* Implements the inline rendering strategy where the Request is rendered by the current HTTP kernel.
|
||||
@@ -33,7 +34,7 @@ class InlineFragmentRenderer extends RoutableFragmentRenderer
|
||||
public function __construct(HttpKernelInterface $kernel, EventDispatcherInterface $dispatcher = null)
|
||||
{
|
||||
$this->kernel = $kernel;
|
||||
$this->dispatcher = $dispatcher;
|
||||
$this->dispatcher = LegacyEventDispatcherProxy::decorate($dispatcher);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -43,7 +44,7 @@ class InlineFragmentRenderer extends RoutableFragmentRenderer
|
||||
*
|
||||
* * alt: an alternative URI to render in case of an error
|
||||
*/
|
||||
public function render($uri, Request $request, array $options = array())
|
||||
public function render($uri, Request $request, array $options = [])
|
||||
{
|
||||
$reference = null;
|
||||
if ($uri instanceof ControllerReference) {
|
||||
@@ -54,10 +55,10 @@ class InlineFragmentRenderer extends RoutableFragmentRenderer
|
||||
// want that as we want to preserve objects (so we manually set Request attributes
|
||||
// below instead)
|
||||
$attributes = $reference->attributes;
|
||||
$reference->attributes = array();
|
||||
$reference->attributes = [];
|
||||
|
||||
// The request format and locale might have been overridden by the user
|
||||
foreach (array('_format', '_locale') as $key) {
|
||||
foreach (['_format', '_locale'] as $key) {
|
||||
if (isset($attributes[$key])) {
|
||||
$reference->attributes[$key] = $attributes[$key];
|
||||
}
|
||||
@@ -80,11 +81,11 @@ class InlineFragmentRenderer extends RoutableFragmentRenderer
|
||||
return SubRequestHandler::handle($this->kernel, $subRequest, HttpKernelInterface::SUB_REQUEST, false);
|
||||
} catch (\Exception $e) {
|
||||
// we dispatch the exception event to trigger the logging
|
||||
// the response that comes back is simply ignored
|
||||
// the response that comes back is ignored
|
||||
if (isset($options['ignore_errors']) && $options['ignore_errors'] && $this->dispatcher) {
|
||||
$event = new GetResponseForExceptionEvent($this->kernel, $request, HttpKernelInterface::SUB_REQUEST, $e);
|
||||
$event = new ExceptionEvent($this->kernel, $request, HttpKernelInterface::SUB_REQUEST, $e);
|
||||
|
||||
$this->dispatcher->dispatch(KernelEvents::EXCEPTION, $event);
|
||||
$this->dispatcher->dispatch($event, KernelEvents::EXCEPTION);
|
||||
}
|
||||
|
||||
// let's clean up the output buffers that were created by the sub-request
|
||||
@@ -113,7 +114,7 @@ class InlineFragmentRenderer extends RoutableFragmentRenderer
|
||||
unset($server['HTTP_IF_MODIFIED_SINCE']);
|
||||
unset($server['HTTP_IF_NONE_MATCH']);
|
||||
|
||||
$subRequest = Request::create($uri, 'get', array(), $cookies, array(), $server);
|
||||
$subRequest = Request::create($uri, 'get', [], $cookies, [], $server);
|
||||
if ($request->headers->has('Surrogate-Capability')) {
|
||||
$subRequest->headers->set('Surrogate-Capability', $request->headers->get('Surrogate-Capability'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user