ProblemDetailsFactory
final class ProblemDetailsFactory (View source)
Creates RFC 9457-style Problem Details responses without exposing exception internals.
Methods
Uses one PSR-17 implementation for response and body stream creation.
Creates a problem response whose instance identifies the current request path.
Returns a 401 bearer challenge for a request lacking a valid API identity.
Returns a 403 response without disclosing which authorization condition failed.
Returns a 404 problem tied to the current request path.
Returns a generic 500 problem that does not expose the captured exception.
Details
__construct
__construct(Psr17Factory $responseFactory)
Uses one PSR-17 implementation for response and body stream creation.
create
ResponseInterface
create(int $status, string $title, string $detail, ServerRequestInterface $request, string $type = 'about:blank', array $extensions = [])
Creates a problem response whose instance identifies the current request path.
unauthenticated
ResponseInterface
unauthenticated(ServerRequestInterface $request)
Returns a 401 bearer challenge for a request lacking a valid API identity.
forbidden
ResponseInterface
forbidden(ServerRequestInterface $request)
Returns a 403 response without disclosing which authorization condition failed.
notFound
ResponseInterface
notFound(ServerRequestInterface $request)
Returns a 404 problem tied to the current request path.
internalServerError
ResponseInterface
internalServerError(ServerRequestInterface $request)
Returns a generic 500 problem that does not expose the captured exception.