PHPackages                             phphd/exception-toolkit - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. phphd/exception-toolkit

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

phphd/exception-toolkit
=======================

Exception processing toolkit

1.2.0(5mo ago)014.2k—3.6%[1 issues](https://github.com/phphd/exception-toolkit/issues)1MITPHPPHP &gt;=8.1CI passing

Since Aug 31Pushed 5mo agoCompare

[ Source](https://github.com/phphd/exception-toolkit)[ Packagist](https://packagist.org/packages/phphd/exception-toolkit)[ RSS](/packages/phphd-exception-toolkit/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (12)Versions (7)Used By (1)

Exception Toolkit
=================

[](#exception-toolkit)

🧰 Provides a set of tools to handle exceptions in PHP applications.

[![Build Status](https://camo.githubusercontent.com/7a86960ed1e54125b0e4800811270877f0d02b1eec256b7a71419f044b5b71a0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f70687068642f657863657074696f6e2d746f6f6c6b69742f63692e79616d6c3f6272616e63683d6d61696e)](https://github.com/phphd/exception-toolkit/actions?query=branch%3Amain)[![Codecov](https://camo.githubusercontent.com/2d561897fc0d83fc075d7a21c95c78c8482da0a6493f7b680f678f0141209977/68747470733a2f2f636f6465636f762e696f2f67682f70687068642f657863657074696f6e2d746f6f6c6b69742f67726170682f62616467652e7376673f746f6b656e3d475a525857595435355a)](https://codecov.io/gh/phphd/exception-toolkit)[![Packagist Downloads](https://camo.githubusercontent.com/522042dd7ca744975b4b8a0795c0a5acbbd91df694e58fd194cf22c7ab23f8bf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f70687068642f657863657074696f6e2d746f6f6c6b69742e737667)](https://packagist.org/packages/phphd/exception-toolkit)[![Licence](https://camo.githubusercontent.com/05264b4c7cf255760ddcb24f7889009679de17e89c157713545a467a39b26d17/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f70687068642f657863657074696f6e2d746f6f6c6b69742e737667)](https://github.com/phphd/exception-toolkit/blob/main/LICENSE)

Installation 📥
--------------

[](#installation-)

1. Install via composer:

    ```
    composer require phphd/exception-toolkit
    ```
2. If you are using Symfony, enable the bundle in the `bundles.php`

    ```
    PhPhD\ExceptionToolkit\Bundle\PhdExceptionToolkitBundle::class => ['all' => true],
    ```

Provided tools ⚙️
-----------------

[](#provided-tools-️)

### Exception Unwrapper

[](#exception-unwrapper)

Allows you to unwrap composite exceptions and get the atomic errors you are interested in:

```
use PhPhD\ExceptionToolkit\Unwrapper\ExceptionUnwrapper;

/** @var ExceptionUnwrapper $unwrapper */

$compositeException = new CompositeException([
    new InvalidEmailException(),
    new CompositeException([
        new InvalidPasswordException(),
    ]),
]);

[$emailError, $passwordError] = $unwrapper->unwrap($compositeException);
```

In this example, errors were retrieved from composite exceptions: `$emailError` will be an instance of `InvalidEmailException` and `$passwordError` will be an instance of `InvalidPasswordException` that were wrapped in the composite exception.

#### Symfony integration

[](#symfony-integration)

In symfony application you could use ExceptionUnwrapper service:

```
public function __construct(
    #[Autowire('@phd_exception_toolkit.exception_unwrapper')]
    private ExceptionUnwrapper $exceptionUnwrapper,
) {}
```

This will provide you with full stack of defined unwrappers bundled into a single instance.

> If you want to define custom unwrapper, you should decorate `phd_exception_toolkit.exception_unwrapper.stack`service.

#### Built-in unwrappers

[](#built-in-unwrappers)

##### Messenger

[](#messenger)

If you are using symfony messenger, `Symfony\Component\Messenger\Exception\WrappedExceptionsInterface`will be unwrapped automatically.

##### Amp

[](#amp)

If you are using Amp, `Amp\CompositeException` will be unwrapped automatically.

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance70

Regular maintenance activity

Popularity26

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~152 days

Total

4

Last Release

168d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/41589422?v=4)[Yevhen Sidelnyk](/maintainers/rela589n)[@rela589n](https://github.com/rela589n)

---

Top Contributors

[![rela589n](https://avatars.githubusercontent.com/u/41589422?v=4)](https://github.com/rela589n "rela589n (13 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/phphd-exception-toolkit/health.svg)

```
[![Health](https://phpackages.com/badges/phphd-exception-toolkit/health.svg)](https://phpackages.com/packages/phphd-exception-toolkit)
```

###  Alternatives

[olimortimer/laravelshoppingcart

Laravel Shoppingcart

4343.2k](/packages/olimortimer-laravelshoppingcart)[rap2hpoutre/remove-stop-words

Remove stop words from a string

1528.3k](/packages/rap2hpoutre-remove-stop-words)[wenhainan/thinkcsv

csv处理组件,导入导出csv

223.4k](/packages/wenhainan-thinkcsv)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
