Search by

dmelin / tantrum

dmelin

The throwable with the energy of a 6 year old.

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

This package is auto-updated.

Last update: 2026-09-25 14:16:30 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