PHP code example of chubbyphp / chubbyphp-http-exception

1. Go to this page and download the library: Download chubbyphp/chubbyphp-http-exception 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/ */

    

chubbyphp / chubbyphp-http-exception example snippets




declare(strict_types=1);

namespace App;

use Chubbyphp\HttpException\HttpException;

$exception = new \RuntimeException('error');

$httpException = HttpException::createBadRequest([
    'key1' => 'value1',
    'key2' => 'value2'
], $exception);