Dont
Dont copied to clipboard
:no_entry_sign: Small set of defensive programming utilities/traits for PHP
trafficstars
Don't
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\DontDeserialiseDont\DontSerialiseDont\DontCloneDont\DontGetDont\DontSetDont\DontCallDont\DontCallStaticDont\DontToStringDont\JustDontDont\DontInstantiate
Usage is straightforward:
use Dont\DontSerialise;
class MyClass
{
use DontSerialise;
}
serialize(new MyClass); // will throw an exception