roave / dont
A small set of traits that can be used to prevent misuse of your objects
Installs: 85 009
Dependents: 2
Suggesters: 0
Security: 0
Stars: 308
Watchers: 17
Forks: 18
Open Issues: 4
Requires
- php: 8.0.*
Requires (Dev)
- infection/infection: ^0.20.0
- phpunit/phpunit: ^9.3
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
Usage is straightforward:
use Dont\DontSerialise; class MyClass { use DontSerialise; } serialize(new MyClass); // will throw an exception