abc / api-problem
API Problems according to RFC 7807
Installs: 9 667
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- doctrine/annotations: ^1.6
Requires (Dev)
- ext-json: *
- phpunit/phpunit: ^9.0
- symfony/debug: ^3.4|^4.0|^5.0
- symfony/http-foundation: ^3.4|^4.0|^5.0
- symfony/validator: ^3.4|^4.0|^5.0
- zircote/swagger-php: ^3.0
This package is not auto-updated.
Last update: 2024-11-04 18:54:23 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.