updated packages
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.
|
||||
|
||||
@@ -81,7 +81,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 +102,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'];
|
||||
}
|
||||
|
||||
@@ -43,7 +43,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 +54,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,7 +80,7 @@ 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);
|
||||
|
||||
@@ -113,7 +113,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