Phred/src/Http/Contracts/ErrorFormatNegotiatorInterface.php
Funky Waddle cf30f3e41a
Some checks failed
CI / PHP ${{ matrix.php }} (8.1) (push) Has been cancelled
CI / PHP ${{ matrix.php }} (8.2) (push) Has been cancelled
CI / PHP ${{ matrix.php }} (8.3) (push) Has been cancelled
M12: Serialization/validation utilities and pagination
2025-12-23 17:40:02 -06:00

21 lines
530 B
PHP

<?php
declare(strict_types=1);
namespace Phred\Http\Contracts;
use Psr\Http\Message\ServerRequestInterface;
interface ErrorFormatNegotiatorInterface
{
/**
* Determine desired API format based on the request (e.g., Accept header).
* Should return 'rest', 'jsonapi', or 'xml'.
*/
public function apiFormat(ServerRequestInterface $request): string;
/**
* Determine if the client prefers an HTML error representation.
*/
public function wantsHtml(ServerRequestInterface $request): bool;
}