Update dependencies

This commit is contained in:
Chris Hunt
2024-02-16 21:36:54 +00:00
parent 22d7a59e59
commit d52ae0d3c3
9569 changed files with 460443 additions and 282416 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;
}