Files
michaelschiemer/src/Framework/ExceptionHandling/Strategy/StrictErrorPolicy.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

28 lines
652 B
PHP

<?php
declare(strict_types=1);
namespace App\Framework\ExceptionHandling\Strategy;
use App\Framework\ExceptionHandling\ErrorContext;
use App\Framework\ExceptionHandling\ErrorDecision;
use App\Framework\ExceptionHandling\ErrorHandlerStrategy;
use ErrorException;
final readonly class StrictErrorPolicy implements ErrorHandlerStrategy
{
/**
* @throws ErrorException
*/
public function handle(ErrorContext $context): ErrorDecision
{
throw new ErrorException(
$context->message,
0,
$context->severity,
$context->file,
$context->line?->toInt()
);
}
}