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

@@ -24,19 +24,17 @@ use Symfony\Component\Stopwatch\StopwatchEvent;
*/
class TimeDataCollector extends DataCollector implements LateDataCollectorInterface
{
private $kernel;
private $stopwatch;
private ?KernelInterface $kernel;
private ?Stopwatch $stopwatch;
public function __construct(KernelInterface $kernel = null, Stopwatch $stopwatch = null)
{
$this->kernel = $kernel;
$this->stopwatch = $stopwatch;
$this->data = ['events' => [], 'stopwatch_installed' => false, 'start_time' => 0];
}
/**
* {@inheritdoc}
*/
public function collect(Request $request, Response $response, \Throwable $exception = null)
public function collect(Request $request, Response $response, \Throwable $exception = null): void
{
if (null !== $this->kernel) {
$startTime = $this->kernel->getStartTime();
@@ -52,22 +50,14 @@ class TimeDataCollector extends DataCollector implements LateDataCollectorInterf
];
}
/**
* {@inheritdoc}
*/
public function reset()
public function reset(): void
{
$this->data = [];
$this->data = ['events' => [], 'stopwatch_installed' => false, 'start_time' => 0];
if (null !== $this->stopwatch) {
$this->stopwatch->reset();
}
$this->stopwatch?->reset();
}
/**
* {@inheritdoc}
*/
public function lateCollect()
public function lateCollect(): void
{
if (null !== $this->stopwatch && isset($this->data['token'])) {
$this->setEvents($this->stopwatch->getSectionEvents($this->data['token']));
@@ -78,7 +68,7 @@ class TimeDataCollector extends DataCollector implements LateDataCollectorInterf
/**
* @param StopwatchEvent[] $events The request events
*/
public function setEvents(array $events)
public function setEvents(array $events): void
{
foreach ($events as $event) {
$event->ensureStopped();
@@ -133,9 +123,6 @@ class TimeDataCollector extends DataCollector implements LateDataCollectorInterf
return $this->data['stopwatch_installed'];
}
/**
* {@inheritdoc}
*/
public function getName(): string
{
return 'time';