PHPackages                             oxygenzsas/whoops - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. oxygenzsas/whoops

ActiveLibrary[HTTP &amp; Networking](/categories/http)

oxygenzsas/whoops
=================

Middleware to use Whoops as error handler

0.0.1(1y ago)025MITPHPPHP &gt;=8.1

Since Feb 16Pushed 1y agoCompare

[ Source](https://github.com/OxygenzSAS/whoops)[ Packagist](https://packagist.org/packages/oxygenzsas/whoops)[ Docs](https://github.com/OxygenzSAS/whoops)[ RSS](/packages/oxygenzsas-whoops/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)Dependencies (11)Versions (2)Used By (0)

middlewares/whoops
==================

[](#middlewareswhoops)

[![Latest Version on Packagist](https://camo.githubusercontent.com/c8c86598e34edd7252b04b33b392b012f45caf149802fa1c2809d5536fccd43c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6964646c6577617265732f77686f6f70732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/middlewares/whoops)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Testing](https://github.com/middlewares/whoops/workflows/testing/badge.svg)](https://github.com/middlewares/whoops/workflows/testing/badge.svg)[![Total Downloads](https://camo.githubusercontent.com/fda77198caebbf6dc3d277adb79b09766354c2fc69f2eea71001697e96f275c5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6964646c6577617265732f77686f6f70732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/middlewares/whoops)

Middleware to use [Whoops](https://github.com/filp/whoops) as error handler.

Requirements
------------

[](#requirements)

- PHP &gt;= 8.1
- A [PSR-7 http library](https://github.com/middlewares/awesome-psr15-middlewares#psr-7-implementations)
- A [PSR-15 middleware dispatcher](https://github.com/middlewares/awesome-psr15-middlewares#dispatcher)

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

[](#installation)

This package is installable and autoloadable via Composer as [middlewares/whoops](https://packagist.org/packages/middlewares/whoops).

```
composer require middlewares/whoops
```

Example
-------

[](#example)

```
$dispatcher = new Dispatcher([
    new Middlewares\Whoops()
]);

$response = $dispatcher->dispatch(new ServerRequest());
```

Usage
-----

[](#usage)

The constructor accepts a `Whoops\Run` instance but creates one automatically if it's not provided. Optionally, you can provide a `Psr\Http\Message\ResponseFactoryInterface` as the second argument to create the response. If it's not defined, [Middleware\\Utils\\Factory](https://github.com/middlewares/utils#factory) will be used to detect it automatically.

```
$whoops = new Whoops\Run();
$responseFactory = new MyOwnResponseFactory();

//Create a Run instance automatically
$middleware = new Middlewares\Whoops();

//Pass your own Run instance
$middleware = new Middlewares\Whoops($whoops);

//Pass a Run instance and ResponseFactory
$middleware = new Middlewares\Whoops($whoops, $responseFactory);
```

### catchErrors

[](#catcherrors)

To catch not only throwable exceptions, but also php errors. This makes whoops to be registered temporary in order to capture the errors using `set_error_handler`. It's enabled by default so, to disable it you have to use `->catchErrors(false)`;

```
//Do not catch errors
$middleware = (new Middlewares\Whoops())->catchErrors(false);
```

### handlerContainer

[](#handlercontainer)

This option allows to define a custom PSR-11 container used to create the intance of `Whoops\Handler\HandlerInterface` based in the `Accept` header in the request.

---

Please see [CHANGELOG](CHANGELOG.md) for more information about recent changes and [CONTRIBUTING](CONTRIBUTING.md) for contributing details.

The MIT License (MIT). Please see [LICENSE](LICENSE) for more information.

###  Health Score

24

—

LowBetter than 30% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 86.5% 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

Unknown

Total

1

Last Release

548d ago

### Community

Maintainers

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

---

Top Contributors

[![oscarotero](https://avatars.githubusercontent.com/u/377873?v=4)](https://github.com/oscarotero "oscarotero (64 commits)")[![desumasuku](https://avatars.githubusercontent.com/u/2109198?v=4)](https://github.com/desumasuku "desumasuku (3 commits)")[![duncan3dc](https://avatars.githubusercontent.com/u/546811?v=4)](https://github.com/duncan3dc "duncan3dc (2 commits)")[![arokettu](https://avatars.githubusercontent.com/u/963485?v=4)](https://github.com/arokettu "arokettu (2 commits)")[![nvanhaezebrouck](https://avatars.githubusercontent.com/u/113363985?v=4)](https://github.com/nvanhaezebrouck "nvanhaezebrouck (1 commits)")[![ajgarlag](https://avatars.githubusercontent.com/u/388184?v=4)](https://github.com/ajgarlag "ajgarlag (1 commits)")[![reisraff](https://avatars.githubusercontent.com/u/4624214?v=4)](https://github.com/reisraff "reisraff (1 commits)")

---

Tags

httppsr-7middlewareservererrorwhoopspsr-15

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/oxygenzsas-whoops/health.svg)

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

###  Alternatives

[middlewares/whoops

Middleware to use Whoops as error handler

33212.5k30](/packages/middlewares-whoops)[mezzio/mezzio

PSR-15 Middleware Microframework

3973.9M133](/packages/mezzio-mezzio)[sunrise/http-router

A powerful solution as the foundation of your project.

16852.3k12](/packages/sunrise-http-router)[middlewares/request-handler

Middleware to execute request handlers

441.8M29](/packages/middlewares-request-handler)[middlewares/fast-route

Middleware to use FastRoute

95208.6k15](/packages/middlewares-fast-route)[middlewares/error-handler

Middleware to handle http errors

14112.5k14](/packages/middlewares-error-handler)

PHPackages © 2026

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