chubbyphp / chubbyphp-http-exception
Creates http exceptions which can be catched and converted to error responses.
Installs: 13 849
Dependents: 9
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^8.2
Requires (Dev)
- chubbyphp/chubbyphp-dev-helper: dev-master
- infection/infection: ^0.29.8
- php-coveralls/php-coveralls: ^2.7.0
- phpstan/extension-installer: ^1.4.3
- phpstan/phpstan: ^2.0.3
- phpunit/phpunit: ^11.5.0
This package is auto-updated.
Last update: 2024-12-08 07:01:08 UTC
README
Description
Creates http exceptions which can be catched and converted to error responses.
Requirements
- php: ^8.2
Installation
Through Composer as chubbyphp/chubbyphp-http-exception.
composer require chubbyphp/chubbyphp-http-exception "^1.2"
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