N°6934 - Symfony 6.4 - upgrade Symfony bundles to 6.4 (#580)

* Update Symfony lib to version ~6.4.0
* Update code missing return type
* Add an iTop general configuration entry to store application secret (Symfony mandatory parameter)
* Use dependency injection in ExceptionListener & UserProvider classes
This commit is contained in:
bdalsass
2023-12-05 13:56:56 +01:00
committed by GitHub
parent 863ab4560c
commit 27ce51ab07
1392 changed files with 44869 additions and 27799 deletions

View File

@@ -13,8 +13,8 @@ namespace Symfony\Component\HttpKernel\Fragment;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\UriSigner;
use Symfony\Component\HttpKernel\Controller\ControllerReference;
use Symfony\Component\HttpKernel\UriSigner;
use Twig\Environment;
/**
@@ -24,13 +24,13 @@ use Twig\Environment;
*/
class HIncludeFragmentRenderer extends RoutableFragmentRenderer
{
private $globalDefaultTemplate;
private $signer;
private $twig;
private $charset;
private ?string $globalDefaultTemplate;
private ?UriSigner $signer;
private ?Environment $twig;
private string $charset;
/**
* @param string $globalDefaultTemplate The global default content (it can be a template name or the content)
* @param string|null $globalDefaultTemplate The global default content (it can be a template name or the content)
*/
public function __construct(Environment $twig = null, UriSigner $signer = null, string $globalDefaultTemplate = null, string $charset = 'utf-8')
{
@@ -42,24 +42,20 @@ class HIncludeFragmentRenderer extends RoutableFragmentRenderer
/**
* Checks if a templating engine has been set.
*
* @return bool
*/
public function hasTemplating()
public function hasTemplating(): bool
{
return null !== $this->twig;
}
/**
* {@inheritdoc}
*
* Additional available options:
*
* * default: The default content (it can be a template name or the content)
* * 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 = [])
public function render(string|ControllerReference $uri, Request $request, array $options = []): Response
{
if ($uri instanceof ControllerReference) {
$uri = (new FragmentUriGenerator($this->fragmentPath, $this->signer))->generate($uri, $request);
@@ -94,10 +90,7 @@ class HIncludeFragmentRenderer extends RoutableFragmentRenderer
return new Response(sprintf('<hx:include src="%s"%s>%s</hx:include>', $uri, $renderedAttributes, $content));
}
/**
* {@inheritdoc}
*/
public function getName()
public function getName(): string
{
return 'hinclude';
}