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

@@ -27,20 +27,14 @@ use Twig\TwigFunction;
*/
class WebProfilerExtension extends ProfilerExtension
{
/**
* @var HtmlDumper
*/
private $dumper;
private HtmlDumper $dumper;
/**
* @var resource
*/
private $output;
/**
* @var int
*/
private $stackLevel = 0;
private int $stackLevel = 0;
public function __construct(HtmlDumper $dumper = null)
{
@@ -60,18 +54,15 @@ class WebProfilerExtension extends ProfilerExtension
}
}
/**
* {@inheritdoc}
*/
public function getFunctions(): array
{
return [
new TwigFunction('profiler_dump', [$this, 'dumpData'], ['is_safe' => ['html'], 'needs_environment' => true]),
new TwigFunction('profiler_dump_log', [$this, 'dumpLog'], ['is_safe' => ['html'], 'needs_environment' => true]),
new TwigFunction('profiler_dump', $this->dumpData(...), ['is_safe' => ['html'], 'needs_environment' => true]),
new TwigFunction('profiler_dump_log', $this->dumpLog(...), ['is_safe' => ['html'], 'needs_environment' => true]),
];
}
public function dumpData(Environment $env, Data $data, int $maxDepth = 0)
public function dumpData(Environment $env, Data $data, int $maxDepth = 0): string
{
$this->dumper->setCharset($env->getCharset());
$this->dumper->dump($data, null, [
@@ -85,7 +76,7 @@ class WebProfilerExtension extends ProfilerExtension
return str_replace("\n</pre", '</pre', rtrim($dump));
}
public function dumpLog(Environment $env, string $message, Data $context = null)
public function dumpLog(Environment $env, string $message, Data $context = null): string
{
$message = twig_escape_filter($env, $message);
$message = preg_replace('/&quot;(.*?)&quot;/', '&quot;<b>$1</b>&quot;', $message);
@@ -109,10 +100,7 @@ class WebProfilerExtension extends ProfilerExtension
return '<span class="dump-inline">'.strtr($message, $replacements).'</span>';
}
/**
* {@inheritdoc}
*/
public function getName()
public function getName(): string
{
return 'profiler';
}