gianarb / angry
A collection of traits to defend classes from mis-use.
Installs: 73 810
Dependents: 6
Suggesters: 0
Security: 0
Stars: 5
Watchers: 2
Forks: 2
Open Issues: 0
pkg:composer/gianarb/angry
Requires
- php: ^7.3 || ~8.0
Requires (Dev)
- phpunit/phpunit: ^9.0
This package is auto-updated.
Last update: 2022-05-15 11:50:49 UTC
README
This library is a collection of traits to stop mis-use of your classes. Based on @ocramius talk "Defensive Programming".
Installation
composer install gianarb/angry "^1.0"
Getting Started
- Block cloneof a class useGianArb\Angry\Unclonabletrait.
- Block invoking of a class e.g. $className();useGianArb\Angry\Uninvokabletrait.
- Block serialization of a class use GianArb\Angry\Unserializabletrait.
- Block all of the above use GianArb\Angry\ClassDefencetrait.
Remember: the best way to write code is be lazy! http://blogoscoped.com/archive/2005-08-24-n14.html.