PHPackages                             maximaster/exceptior - 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. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. maximaster/exceptior

ActiveLibrary[Debugging &amp; Profiling](/categories/debugging)

maximaster/exceptior
====================

Functions collection to ease exception handling.

v1.1.1(1y ago)03MITPHPPHP ^8.2

Since Aug 30Pushed 1y ago2 watchersCompare

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

READMEChangelogDependencies (3)Versions (4)Used By (0)

maximaster/exceptior
====================

[](#maximasterexceptior)

Functions collection to ease exception handling.

```
composer require maximaster/exceptior
```

CASE #1: convert throwing void function into boolean
----------------------------------------------------

[](#case-1-convert-throwing-void-function-into-boolean)

```
use Maximaster\Exceptior\Ex;

$noOpeation = function(): void {};
$wouldThrow = fn () => throw new Exception('hello');

Ex::boolize($noOpeation); // === true
Ex::boolize($wouldThrow); // === false
```

CASE #2: convert throwing function with return into returning value of your choice
----------------------------------------------------------------------------------

[](#case-2-convert-throwing-function-with-return-into-returning-value-of-your-choice)

```
use Maximaster\Exceptior\Ex;

$giveString = fn () => 'hello'
$wouldThrow = fn () => throw new Exception('no hello');

Ex::suppressInto($giveString, 'fail'); // === 'hello'
Ex::suppressInto($wouldThrow, 'fail'); // === 'fail'
```

CASE #3: convert exception into another exception
-------------------------------------------------

[](#case-3-convert-exception-into-another-exception)

```
use Maximaster\Exceptior\Ex;

$giveString = fn () => 'hello'
$wouldThrow = fn () => throw new Exception('no hello');
$converter = fn (Throwable $thrown) => new RuntimeException($thrown->getMessage());

Ex::convert($giveString, $converter); // === 'hello'
Ex::convert($wouldThrow, $converter); // throws RuntimeException
```

CASE #4: normalize thrown exception to value provided by callable
-----------------------------------------------------------------

[](#case-4-normalize-thrown-exception-to-value-provided-by-callable)

```
use Maximaster\Exceptior\Ex;

$giveString = fn () => 'hello'
$wouldThrow = fn () => throw new Exception('no hello');
$normaizeToMessage = fn (Throwable $throwable) => $throwable->getMessage();

Ex::normalize($giveString, $normaizeToMessage); // === 'hello'
Ex::normalize($wouldThrow, $normaizeToMessage); // === 'no hello'
```

CASE #5: return worker value or null if worker throws an exception
------------------------------------------------------------------

[](#case-5-return-worker-value-or-null-if-worker-throws-an-exception)

```
$giveString = fn () => 'hello'
$wouldThrow = fn () => throw new Exception('no hello');

Ex::nullize($giveString); // === 'hello'
Ex::nullize($wouldThrow); // === null
```

Development
-----------

[](#development)

Fork → Edit → `composer check` → PR.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity54

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

Total

3

Last Release

620d ago

### Community

Maintainers

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

---

Top Contributors

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

###  Code Quality

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/maximaster-exceptior/health.svg)

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

###  Alternatives

[symfony/stopwatch

Provides a way to profile code

2.8k387.2M918](/packages/symfony-stopwatch)[fruitcake/laravel-debugbar

PHP Debugbar integration for Laravel

19.1k662.9k29](/packages/fruitcake-laravel-debugbar)[spatie/ignition

A beautiful error page for PHP applications.

510147.6M69](/packages/spatie-ignition)[jokkedk/webgrind

Webgrind is a Xdebug profiling web frontend in PHP5. It implements a subset of the features of kcachegrind and installs in seconds and works on all platforms. For quick'n'dirty optimizations it does the job.

3.3k193.0k](/packages/jokkedk-webgrind)[koriym/printo

An object graph visualizer.

1421.8M2](/packages/koriym-printo)[soloterm/dumps

A Laravel command to intercept dumps from your Laravel application.

125285.7k3](/packages/soloterm-dumps)

PHPackages © 2026

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