roave / dont
A small set of traits that can be used to prevent misuse of your objects
Installs: 255 573
Dependents: 5
Suggesters: 0
Security: 0
Stars: 400
Watchers: 11
Forks: 21
Open Issues: 10
pkg:composer/roave/dont
Requires
- php: ~8.0.0 || ~8.1.0 || ~8.2.0
Requires (Dev)
- infection/infection: ^0.26.16
- phpunit/phpunit: ^9.5.26
This package is auto-updated.
Last update: 2025-10-12 09:50:25 UTC
README
roave/dont
is a small PHP package aimed at enforcing good
practices when it comes to designing
defensive code.
Installation
composer require roave/dont
Usage
The package currently provides the following traits:
Dont\DontDeserialise
Dont\DontSerialise
Dont\DontClone
Dont\DontGet
Dont\DontSet
Dont\DontCall
Dont\DontCallStatic
Dont\DontToString
Dont\JustDont
Dont\DontInstantiate
Usage is straightforward:
use Dont\DontSerialise; class MyClass { use DontSerialise; } serialize(new MyClass); // will throw an exception