PHPackages                             paragonie/corner - 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. paragonie/corner

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

paragonie/corner
================

Generic PHP Exceptions and Errors, made user-friendly.

v2.0.1(6y ago)63620.4k—6.2%48ISCPHPPHP ^7.1|^8CI failing

Since Dec 20Pushed 5y ago5 watchersCompare

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

READMEChangelog (3)Dependencies (3)Versions (5)Used By (8)

Corner
======

[](#corner)

[![Linux Build Status](https://camo.githubusercontent.com/283a36a955c836d6b7514da988bcaa68f6c342002302c8b5bb795aeec17459a1/68747470733a2f2f7472617669732d63692e6f72672f70617261676f6e69652f636f726e65722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/paragonie/corner)[![Latest Stable Version](https://camo.githubusercontent.com/c759f74c042263f583a3c0861f0d38a27f0b393e8cf3ea744b3336e910b12f88/68747470733a2f2f706f7365722e707567782e6f72672f70617261676f6e69652f636f726e65722f762f737461626c65)](https://packagist.org/packages/paragonie/corner)[![Latest Unstable Version](https://camo.githubusercontent.com/974004f1f3f53f64bc11e4b29275cdaec0866beb612c082f1e5cbbae25bf3a16/68747470733a2f2f706f7365722e707567782e6f72672f70617261676f6e69652f636f726e65722f762f756e737461626c65)](https://packagist.org/packages/paragonie/corner)[![License](https://camo.githubusercontent.com/1ce647a3a769ffa08098b8122bff8ac4ec212a3654330d0437f1df472cda9f9d/68747470733a2f2f706f7365722e707567782e6f72672f70617261676f6e69652f636f726e65722f6c6963656e7365)](https://packagist.org/packages/paragonie/corner)[![Downloads](https://camo.githubusercontent.com/8dfa1d3b17b01ca76a6420c08090a0a1bc62393d7b0b1a3fdc87db4348a404ed/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f70617261676f6e69652f636f726e65722e737667)](https://packagist.org/packages/paragonie/corner)

PHP Exceptions and Errors designed to prevent your users from sharp corners. Inspired by [Rust's helpful error messages](https://twitter.com/acfoltzer/status/1074813646625169408).

- Version 2.x: **Requires PHP 7.1 or newer.**
- Version 1.x: Requires PHP 5.4 or newer.

Motivation
----------

[](#motivation)

There are already libraries like [Whoops](https://github.com/filp/whoops) which focus on taking existing uncaught Exceptions and giving them a user interface.

Rather than take control of your entire UI output, Corner extends the base `Throwable` interface and `Exception`/`Error` classes and makes them more useful even in non-UI contexts.

Corner's Extended Exception API
-------------------------------

[](#corners-extended-exception-api)

### `getHelpfulMessage()`

[](#gethelpfulmessage)

> What *exactly* is going on here?

Imagine an email. `Throwable::getMessage()` can be likened to the subject line. In traditional exceptions, the closest thing you have to a message body is `getTraceAsString()`.

In Corner, the "helpful message" is meant to be a full-text explanation of the problem. ASCII art diagrams (hard-coded or generated from the source code, if applicable) are permitted.

### `getSnippet($before = 0, $after = 0, $traceWalk = 0)`

[](#getsnippetbefore--0-after--0-tracewalk--0)

> What was the code surrounding the exception doing?

By default, this returns the line of PHP code that triggered the exception.

You can optionally pass a number of leading and trailing lines to this method to read more text from the source code file. The third argument allows you to excerpt snippets of code from within the stack trace.

The main use case for `getSnippet()` is to generate helpful error messages for `getHelpfulMessage()`.

### `getSupportLink()`

[](#getsupportlink)

> Where can I find help?

The intent of this method is to give the developer using your project the quickest possible path to troubleshooting and solving the problem that they're most likely facing if this Exception / Error gets thrown.

If possible, link to a specific section of your project's documentation (including page anchors, if applicable) to get the developer closer to the solution to whatever problem they're encountering.

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity50

Moderate usage in the ecosystem

Community21

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 71.4% 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 ~132 days

Total

4

Last Release

2311d ago

Major Versions

v1.x-dev → v2.0.02018-12-20

PHP version history (3 changes)v1.0.0PHP ^5.4|^7

v2.0.0PHP ^7.1

v2.0.1PHP ^7.1|^8

### Community

Maintainers

![](https://www.gravatar.com/avatar/05d241256cda885139a5697d3bb536b5cec3b430c1adb9c524bf92a37a55758d?d=identicon)[paragonie-scott](/maintainers/paragonie-scott)

---

Top Contributors

[![paragonie-security](https://avatars.githubusercontent.com/u/15914520?v=4)](https://github.com/paragonie-security "paragonie-security (10 commits)")[![SignpostMarv](https://avatars.githubusercontent.com/u/304403?v=4)](https://github.com/SignpostMarv "SignpostMarv (4 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/paragonie-corner/health.svg)

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

###  Alternatives

[marcj/topsort

High-Performance TopSort/Dependency resolving algorithm

24715.6M50](/packages/marcj-topsort)[livewire/volt

An elegantly crafted functional API for Laravel Livewire.

4195.3M84](/packages/livewire-volt)

PHPackages © 2026

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