PHPackages                             mouf/utils.composite-exception - 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. mouf/utils.composite-exception

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mouf/utils.composite-exception
==============================

This project contains a simple PHP exception that can aggregate multiple exceptions in one.

v1.0.0(10y ago)1252.0k↓40.6%13MITPHP

Since Sep 18Pushed 8y ago4 watchersCompare

[ Source](https://github.com/thecodingmachine/utils.composite-exception)[ Packagist](https://packagist.org/packages/mouf/utils.composite-exception)[ RSS](/packages/mouf-utilscomposite-exception/feed)WikiDiscussions 1.0 Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (3)

[![Latest Stable Version](https://camo.githubusercontent.com/9415e067a10a3666afae9a765144a2b6ba43a14f3c04de5abd38f83171295c5f/68747470733a2f2f706f7365722e707567782e6f72672f6d6f75662f7574696c732e636f6d706f736974652d657863657074696f6e2f76657273696f6e)](https://packagist.org/packages/mouf/utils.composite-exception)[![Latest Unstable Version](https://camo.githubusercontent.com/eb3cdfad767b4b7f0936790b10184e83c2a69f79b7f3dc84c22d4bf7f6ce1c36/68747470733a2f2f706f7365722e707567782e6f72672f6d6f75662f7574696c732e636f6d706f736974652d657863657074696f6e2f762f756e737461626c65)](//packagist.org/packages/mouf/utils.composite-exception)[![Total Downloads](https://camo.githubusercontent.com/a94c4617de123fb902d34e5febbc482b10a087047fe672b5d5a4658486b6c0ab/68747470733a2f2f706f7365722e707567782e6f72672f6d6f75662f7574696c732e636f6d706f736974652d657863657074696f6e2f646f776e6c6f616473)](https://packagist.org/packages/mouf/utils.composite-exception)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/b19232650b70a13e49c28accac8f47c2ebcd8e7b628a2d67d433e804aca7130a/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f746865636f64696e676d616368696e652f7574696c732e636f6d706f736974652d657863657074696f6e2f6261646765732f7175616c6974792d73636f72652e706e673f623d312e30)](https://scrutinizer-ci.com/g/thecodingmachine/utils.composite-exception/?branch=1.0)[![Build Status](https://camo.githubusercontent.com/4a686f97872761027f5ff9c54adf3a36078cbc89a0db0aaf3ff934389195a822/68747470733a2f2f7472617669732d63692e6f72672f746865636f64696e676d616368696e652f7574696c732e636f6d706f736974652d657863657074696f6e2e7376673f6272616e63683d312e30)](https://travis-ci.org/thecodingmachine/utils.composite-exception)[![Coverage Status](https://camo.githubusercontent.com/81571f14964e0cad4b4f1267ff7a142c295656ff4a04f9ff5fc093b4e8b0ce54/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f746865636f64696e676d616368696e652f7574696c732e636f6d706f736974652d657863657074696f6e2f62616467652e7376673f6272616e63683d312e3026736572766963653d676974687562)](https://coveralls.io/github/thecodingmachine/utils.composite-exception?branch=1.0)

Composite exception
===================

[](#composite-exception)

This project contains a simple PHP exception that can aggregate multiple exceptions in one. The rationale behind this idea is to allow exceptions to be triggered in loops, and to throw only one at the end of your script:

Installation
------------

[](#installation)

You can install this package through Composer:

```
{
    "require": {
        "mouf/utils.composite-exception": "~1.0"
    }
}
```

The packages adheres to the [SemVer](http://semver.org/) specification, and there will be full backward compatibility between minor versions.

Usage
-----

[](#usage)

This package contains a `CompositeException` class with 2 methods: `add(\Throwable $e)` and `isEmtpy()`.

Typical usage:

```
use Mouf\Utils\CompositeException;

$compositeException = new CompositeException();

foreach (...) {
    try {
        // Do stuff
    } catch (\Exception $e) {
        // Add exceptions to the composite exception
        $compositeException->add($e);
    }
}

if (!$compositeException->isEmpty()) {
    // If not empty, let's throw the composite exception.
    throw $compositeException;
}
```

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 80% 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 ~0 days

Total

2

Last Release

3895d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1104771?v=4)[mouf](/maintainers/mouf)[@Mouf](https://github.com/Mouf)

---

Top Contributors

[![moufmouf](https://avatars.githubusercontent.com/u/1290952?v=4)](https://github.com/moufmouf "moufmouf (4 commits)")[![Jfb77](https://avatars.githubusercontent.com/u/209118712?v=4)](https://github.com/Jfb77 "Jfb77 (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mouf-utilscomposite-exception/health.svg)

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

###  Alternatives

[gpslab/domain-event-bundle

Bundle to create the domain layer of your DDD application

1427.1k](/packages/gpslab-domain-event-bundle)[dev-lnk/laravel-code-builder

Generate classes and files from table schema

194.7k](/packages/dev-lnk-laravel-code-builder)

PHPackages © 2026

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