Files
michaelschiemer/src/Framework/ExceptionHandling/Metrics/ExceptionMetrics.php
Michael Schiemer c93d3f07a2
All checks were successful
Test Runner / test-php (push) Successful in 31s
Deploy Application / deploy (push) Successful in 1m42s
Test Runner / test-basic (push) Successful in 7s
fix(Console): add void as valid return type for command methods
The MethodSignatureAnalyzer was rejecting command methods with void return
type, causing the schedule:run command to fail validation.
2025-11-26 06:16:09 +01:00

43 lines
1.1 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Framework\ExceptionHandling\Metrics;
/**
* Exception Metrics
*
* Immutable value object for exception metrics.
*/
final readonly class ExceptionMetrics
{
/**
* @param int $totalCount Total exception count
* @param array<string, int> $byClass Count by exception class
* @param array<string, int> $byComponent Count by component
* @param float $averageExecutionTimeMs Average execution time in milliseconds
*/
public function __construct(
public int $totalCount = 0,
public array $byClass = [],
public array $byComponent = [],
public float $averageExecutionTimeMs = 0.0
) {
}
/**
* Convert to array for serialization
*
* @return array<string, mixed>
*/
public function toArray(): array
{
return [
'total_count' => $this->totalCount,
'by_class' => $this->byClass,
'by_component' => $this->byComponent,
'average_execution_time_ms' => $this->averageExecutionTimeMs,
];
}
}