chubbyphp / chubbyphp-http-exception

Creates http exceptions which can be catched and converted to error responses.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

chubbyphp-http-exception

CI Coverage Status Mutation testing badge Latest Stable Version Total Downloads Monthly Downloads

bugs code_smells coverage duplicated_lines_density ncloc sqale_rating alert_status reliability_rating security_rating sqale_index vulnerabilities

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

About

Creates http exceptions which can be catched and converted to error responses.

License:MIT License


Languages

Language:PHP 100.0%