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

@@ -26,18 +26,12 @@ class MemoryDataCollector extends DataCollector implements LateDataCollectorInte
$this->reset();
}
/**
* {@inheritdoc}
*/
public function collect(Request $request, Response $response, \Throwable $exception = null)
public function collect(Request $request, Response $response, \Throwable $exception = null): void
{
$this->updateMemoryUsage();
}
/**
* {@inheritdoc}
*/
public function reset()
public function reset(): void
{
$this->data = [
'memory' => 0,
@@ -45,10 +39,7 @@ class MemoryDataCollector extends DataCollector implements LateDataCollectorInte
];
}
/**
* {@inheritdoc}
*/
public function lateCollect()
public function lateCollect(): void
{
$this->updateMemoryUsage();
}
@@ -58,31 +49,22 @@ class MemoryDataCollector extends DataCollector implements LateDataCollectorInte
return $this->data['memory'];
}
/**
* @return int|float
*/
public function getMemoryLimit()
public function getMemoryLimit(): int|float
{
return $this->data['memory_limit'];
}
public function updateMemoryUsage()
public function updateMemoryUsage(): void
{
$this->data['memory'] = memory_get_peak_usage(true);
}
/**
* {@inheritdoc}
*/
public function getName(): string
{
return 'memory';
}
/**
* @return int|float
*/
private function convertToBytes(string $memoryLimit)
private function convertToBytes(string $memoryLimit): int|float
{
if ('-1' === $memoryLimit) {
return -1;
@@ -100,11 +82,11 @@ class MemoryDataCollector extends DataCollector implements LateDataCollectorInte
switch (substr($memoryLimit, -1)) {
case 't': $max *= 1024;
// no break
// no break
case 'g': $max *= 1024;
// no break
// no break
case 'm': $max *= 1024;
// no break
// no break
case 'k': $max *= 1024;
}