1. Go to this page and download the library: Download chiron/http-exceptions library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
chiron / http-exceptions example snippets
throw new \Chiron\Http\Exception\Client\BadRequestHttpException();
$e = new \Chiron\Http\Exception\Client\BadRequestHttpException("Invalid syntax !");
throw $e->setHeaders(['X-Custom-Header' => 'foobar']);
$e = new \Chiron\Http\Exception\Client\ForbiddenHttpException();
$e->setTitle('You do not have enough credit.');
$e->setDetail('Your current balance is 30, but that costs 50.');
$e->setType('https://example.com/probs/out-of-credit');
$e->setIntance('https://example.net/account/12345/msgs/abc');
$e->setAdditionalData(['balance' => 30, 'accounts' => ['https://example.net/account/12345', 'https://example.net/account/67890']]);
throw $e;