abc/api-problem

API Problems according to RFC 7807

Maintainers

👁 aboutcoders

Package info

github.com/aboutcoders/php-api-problem

pkg:composer/abc/api-problem

Statistics

Installs: 9 994

Dependents: 1

Suggesters: 0

Stars: 1

Open Issues: 0

0.1.1 2020-03-01 19:18 UTC

Requires

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT ef40a61c883518c73c22e76bcc8806825ff7ae1d

  • Hannes Schulz <hannes.schulz.woop@aboutcoders.com>

jsonrfc7807

This package is not auto-updated.

Last update: 2026-06-16 02:40:54 UTC


README

A PHP library to describe API problems according to RFC 7870.

Installation

composer require abc/api-problem

Usage

use Abc\ApiProblem;

$apiProblem = new ApiProblem(
 'http://domain.tld/problem/resource-not-found'),
 'Resource Not Found',
 404,
 sprintf('Resource with id "%s" not found', $id),
 $requestUri
);

$json = $apiProblem->toJson();

License

The MIT License (MIT). Please see License File for more information.