gianarb/angry

This package is abandoned and no longer maintained. No replacement package was suggested.

A collection of traits to defend classes from mis-use.

1.0.0 2021-01-25 09:09 UTC

This package is auto-updated.

Last update: 2022-05-15 11:50:49 UTC


README

Build Status

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 use GianArb\Angry\Unclonable trait.
  • Block invoking of a class e.g. $className(); use GianArb\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.