dmelin/tantrum

The throwable with the energy of a 6 year old.

Maintainers

Package info

github.com/dmelin/php-tantrum

pkg:composer/dmelin/tantrum

Transparency log

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-05-25 13:18 UTC

This package is auto-updated.

Last update: 2026-07-25 13:38:36 UTC


README

The throwable with the energy of a 6 year old.

Installation

composer require dmelin/tantrum

Usage

use DMelin\Tantrum\Tantrum;

throw new Tantrum('cant open file.', 2);

Output:

CANT. OPEN. FILE!

Rage Levels

Tantrum accepts a rage level from 1 to 3. Values outside this range are clamped. Default rage is 1.

Rage 1

throw new Tantrum('cant open file.', 1);
CANT OPEN FILE!

Rage 2

throw new Tantrum('cant open file.', 2);
CANT. OPEN. FILE!

Rage 3

throw new Tantrum('cant open file.', 3);
٩(ఠ益ఠ)۶ CANT! OPEN! FILE!!!

Behavior

  • Messages are converted to uppercase
  • Periods become exclamation marks
  • Rage 2 replaces spaces with .
  • Rage 3 replaces spaces with ! and triples the final exclamation marks
  • Extends RuntimeException and can be caught as such
  • Supports exception chaining via the optional third parameter

Testing

composer install
vendor/bin/phpunit

License

MIT