35
GitHub - Roave/Dont: Small set of defensive programming utilities/traits for PHP
source link: https://github.com/Roave/Dont
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
README.md
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 seven traits:
Dont\DontDeserialise
Dont\DontSerialize
Dont\DontClone
Dont\DontGet
Dont\DontSet
Dont\DontCall
Dont\DontCallStatic
Usage is straightforward:
use Dont\DontSerialise; class MyClass { use DontSerialise; } serialize(new MyClass); // will throw an exception
The same applies to DontDeserialise
, but this
time with unserialize()
.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK