dmelin / tantrum
The throwable with the energy of a 6 year old.
v1.0.0
2026-05-25 13:18 UTC
Requires
- php: >=8.0
Requires (Dev)
- phpunit/phpunit: ^9.5 || ^10.0 || ^11.0
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
RuntimeExceptionand can be caught as such - Supports exception chaining via the optional third parameter
Testing
composer install vendor/bin/phpunit
License
MIT