PHPackages                             thesis/exceptionally - 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. thesis/exceptionally

ActiveLibrary

thesis/exceptionally
====================

Thesis Exceptionally

0.2.0(1mo ago)501MITPHPPHP ^8.3CI passing

Since Aug 3Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/thesis-php/exceptionally)[ Packagist](https://packagist.org/packages/thesis/exceptionally)[ Fund](https://www.tinkoff.ru/cf/5MqZQas2dk7)[ RSS](/packages/thesis-exceptionally/feed)WikiDiscussions 0.3.x Synced 1mo ago

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

Thesis Exceptionally
====================

[](#thesis-exceptionally)

A tiny PHP library that converts errors to exceptions.

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

[](#installation)

```
composer require thesis/exceptionally
```

Requires PHP 8.3+.

Usage
-----

[](#usage)

```
use function Thesis\exceptionally;

// Converts PHP errors to ErrorException
$content = exceptionally(static fn() => file_get_contents('/path/to/file'));
```

Many PHP functions trigger errors instead of throwing exceptions. This makes error handling inconsistent and cumbersome. `exceptionally()` wraps a callable and converts any triggered error into a native [ErrorException](https://php.net/manual/class.errorexception.php).

### Error suppression operator

[](#error-suppression-operator)

Errors suppressed with `@` are not converted to exceptions:

```
// Does not throw — the error is suppressed
$content = exceptionally(static fn() => @file_get_contents('/path/to/file'));
```

### Filtering by error level

[](#filtering-by-error-level)

By default, all levels except `E_DEPRECATED` and `E_USER_DEPRECATED` are converted. Deprecations typically come from third-party libraries and should not interrupt execution.

You can specify which levels to convert:

```
// Convert notices
$result = exceptionally($function, E_USER_NOTICE);

// Convert warnings and notices
$result = exceptionally($function, E_USER_WARNING | E_USER_NOTICE);

// Convert all, including deprecations
$result = exceptionally($function, E_ALL);
```

License
-------

[](#license)

MIT

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance91

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity67

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

Total

4

Last Release

45d ago

PHP version history (2 changes)0.1.0PHP ^7.1

0.2.0PHP ^8.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2552865?v=4)[Valentin Udaltsov](/maintainers/vudaltsov)[@vudaltsov](https://github.com/vudaltsov)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/thesis-exceptionally/health.svg)

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

PHPackages © 2026

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