for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace FRZB\Component\RequestMapper\ExceptionFormatter\Formatter;
use FRZB\Component\RequestMapper\Data\ContractError;
use FRZB\Component\RequestMapper\Data\ContractErrorInterface;
use FRZB\Component\RequestMapper\Locator\ExceptionFormatterLocatorInterface as ExceptionFormatterLocator;
use JetBrains\PhpStorm\Pure;
use Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag;
use Symfony\Component\HttpKernel\Exception\HttpException;
#[AutoconfigureTag(ExceptionFormatterLocator::EXCEPTION_FORMATTERS_TAG)]
class HttpExceptionFormatter implements FormatterInterface
{
#[Pure]
public function __invoke(HttpException $e): ContractErrorInterface
return new ContractError($e->getMessage(), $e->getStatusCode(), trace: $e->getTrace());
}
public static function getExceptionClass(): string
return HttpException::class;
public static function getPriority(): int
return 2;