roave / dont
A small set of traits that can be used to prevent misuse of your objects
Installs: 251 092
Dependents: 6
Suggesters: 0
Security: 0
Stars: 399
Watchers: 13
Forks: 21
Open Issues: 10
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: 2024-12-21 07:22:14 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