roave / dont
A small set of traits that can be used to prevent misuse of your objects
Installs: 250 307
Dependents: 6
Suggesters: 0
Security: 0
Stars: 400
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-10-30 02:36:24 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