gianarb / angry
A collection of traits to defend classes from mis-use.
Installs: 71 681
Dependents: 6
Suggesters: 0
Security: 0
Stars: 5
Watchers: 2
Forks: 2
Open Issues: 0
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
clone
of a class useGianArb\Angry\Unclonable
trait. - Block invoking of a class e.g.
$className();
useGianArb\Angry\Uninvokable
trait. - Block serialization of a class use
GianArb\Angry\Unserializable
trait. - Block all of the above use
GianArb\Angry\ClassDefence
trait.
Remember: the best way to write code is be lazy! http://blogoscoped.com/archive/2005-08-24-n14.html.