The MethodSignatureAnalyzer was rejecting command methods with void return type, causing the schedule:run command to fail validation.
43 lines
1.1 KiB
PHP
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,
|
|
];
|
|
}
|
|
}
|