chubbyphp / chubbyphp-http-exception
创建可以被捕获并转换为错误响应的 http 异常。
1.1.0
2023-12-02 17:19 UTC
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-09-10 19:57:10 UTC
README
描述
创建可以被捕获并转换为错误响应的 http 异常。
要求
- php: ^8.1
安装
通过 Composer 作为 chubbyphp/chubbyphp-http-exception 安装。
composer require chubbyphp/chubbyphp-http-exception "^1.1"
用法
<?php declare(strict_types=1); namespace App; use Chubbyphp\HttpException\HttpException; $exception = new \RuntimeException('error'); $httpException = HttpException::createBadRequest([ 'key1' => 'value1', 'key2' => 'value2' ], $exception);
版权
2024 Dominik Zogg