Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 549 Bytes

README.md

File metadata and controls

30 lines (21 loc) · 549 Bytes

API-Problem

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.