chubbyphp / chubbyphp-http-exception
Creates http exceptions which can be catched and converted to error responses.
Installs: 13 211
Dependents: 9
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^8.1
Requires (Dev)
- chubbyphp/chubbyphp-dev-helper: dev-master
- infection/infection: ^0.27.8
- php-coveralls/php-coveralls: ^2.7.0
- phpstan/extension-installer: ^1.3.1
- phpstan/phpstan: ^1.10.45
- phpunit/phpunit: ^10.4.2
This package is auto-updated.
Last update: 2024-10-10 20:10:50 UTC
README
Description
Creates http exceptions which can be catched and converted to error responses.
Requirements
- php: ^8.1
Installation
Through Composer as chubbyphp/chubbyphp-http-exception.
composer require chubbyphp/chubbyphp-http-exception "^1.1"
Usage
<?php declare(strict_types=1); namespace App; use Chubbyphp\HttpException\HttpException; $exception = new \RuntimeException('error'); $httpException = HttpException::createBadRequest([ 'key1' => 'value1', 'key2' => 'value2' ], $exception);
Copyright
2024 Dominik Zogg