PHPackages                             cubicmushroom/exceptions - 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. cubicmushroom/exceptions

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

cubicmushroom/exceptions
========================

A basic, abstract exceptions class

1.0.5(11y ago)02063MITPHPPHP &gt;= 5.4

Since Jan 31Pushed 11y ago1 watchersCompare

[ Source](https://github.com/cubicmushroom/exceptions)[ Packagist](https://packagist.org/packages/cubicmushroom/exceptions)[ RSS](/packages/cubicmushroom-exceptions/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (7)Used By (3)

[![Build Status](https://camo.githubusercontent.com/f130ac4a4bde91495caa7b479d5ac6f61b3a02026e49c3ef4710c5dcb657d74a/68747470733a2f2f7472617669732d63692e6f72672f63756269636d757368726f6f6d2f657863657074696f6e732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/cubicmushroom/exceptions)

Cubic Mushroom Exceptions
=========================

[](#cubic-mushroom-exceptions)

This library provides just a single abstract exception class with it's own bild() method for easily creating exceptions with various properties, passed as an array of arguments.

How to use
----------

[](#how-to-use)

Just have a look at the `src/CubicMushroom/Exceptions/AbstractException` class methods for basic methods, but here is a brief overview...

`AbstractException` provides `build()` method that can be used to prepare exceptions to be thrown.

When using `build()`, you don't need to pass in a $message, $code. If you don't the default for the class will be used. This is returned by the classes `getDefaultMessage()` and `getDefaultCode()` methods, if they exist.

As it's not helpful when an exception doesn't have a message, if no message is either passed, or a default set in the exception class, a `MissingExceptionMessageException` will be thrown.

The `build()` method also accepts a second array parameter. If passed, the `build()` method will attempt to set all the properties on the build exception using the setter for the property. If the setter is not found, then a `SetterNotFoundException` will be thrown.

Roadmap
-------

[](#roadmap)

1. Add way of defining required additional parameters
2. More stuff, as I think of it

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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 ~4 days

Total

6

Last Release

4097d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b156769d704438a2a9e79cd9f7b7a01c8a7b17a191b389469ae55de8f0c982a6?d=identicon)[ToG](/maintainers/ToG)

---

Top Contributors

[![toby-griffiths](https://avatars.githubusercontent.com/u/4817007?v=4)](https://github.com/toby-griffiths "toby-griffiths (38 commits)")

###  Code Quality

TestsCodeception

### Embed Badge

![Health badge](/badges/cubicmushroom-exceptions/health.svg)

```
[![Health](https://phpackages.com/badges/cubicmushroom-exceptions/health.svg)](https://phpackages.com/packages/cubicmushroom-exceptions)
```

###  Alternatives

[dzava/lighthouse

Interface for the Google Lighthouse project

4010.4k](/packages/dzava-lighthouse)

PHPackages © 2026

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