PHPackages                             b2r/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. b2r/exception

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

b2r/exception
=============

b2r Exception Component

v0.3.0(9y ago)01752MITPHPPHP &gt;=7.0

Since Feb 1Pushed 9y ago1 watchersCompare

[ Source](https://github.com/b2r/php-exception)[ Packagist](https://packagist.org/packages/b2r/exception)[ Docs](https://github.com/b2r/php-exception)[ RSS](/packages/b2r-exception/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (6)Used By (2)

b2rPHP: Exception
=================

[](#b2rphp-exception)

Common exceptions in my library

[![Build Status](https://camo.githubusercontent.com/199b48d6ea33940c6ef4cb70a56c04201e702e473456fe445a11537b8a2b1ae7/68747470733a2f2f7472617669732d63692e6f72672f6232722f7068702d657863657074696f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/b2r/php-exception)

- All exception implements `ExceptionInterface`
- All exception uses `ExceptionTrait`
- [CHANGELOG](CHANGELOG.md)
- [Packagist](https://packagist.org/packages/b2r/exception)

Exception classes
-----------------

[](#exception-classes)

- Exception
    - InvalidClassMemberException
        - InvalidMethodException
        - InvalidPropertyException
    - InvalidIndexException
    - InvalidKeyException
    - InvalidTypeException
        - InvalidParameterTypeException
    - IOException
        - FileNotFoundException
        - DirectoryNotFoundException
    - NameException
- InvalidArgumentException
- LogicException
- RuntimeException
- ValidationException

Utility/Helper classes
----------------------

[](#utilityhelper-classes)

- Utils: Utility functions
- Finder: Lookup/resolve class name

InvalidTypeException sample
---------------------------

[](#invalidtypeexception-sample)

```
use b2r\Component\Exception\InvalidTypeException;

$e = new InvalidTypeException('$key', 'string|int', []); // Variable name, Valid type, Invalid type value
echo $e->message; #=>"$key must be of the type `string|int`, but `array` given"
```

Finder sample
-------------

[](#finder-sample)

Finder lookup/resolve class name easily.

```
use b2r\Component\Exception\Finder as E;

$e = E::Type(); #=>'b2r\Component\Exception\InvalidTypeException'
throw new $e('name', 'string|int', null);
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community11

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

Total

5

Last Release

3357d ago

### Community

Maintainers

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

---

Top Contributors

[![b2r](https://avatars.githubusercontent.com/u/74344?v=4)](https://github.com/b2r "b2r (20 commits)")

---

Tags

exceptionphpexception

### Embed Badge

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

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

###  Alternatives

[pear/pear_exception

The PEAR Exception base class.

9880.2M101](/packages/pear-pear-exception)[yireo/magento2-webp2

Magento 2 module to add WebP support to the Magento frontend

2091.2M7](/packages/yireo-magento2-webp2)[phpattempt/phpattempt

Helper function to enforce error-first approach in your code

1710.4k](/packages/phpattempt-phpattempt)

PHPackages © 2026

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