roave/dont
A small set of traits that can be used to prevent misuse of your objects
Maintainers
1.6.0
2022-12-06 14:04 UTC
Requires
- php: ~8.0.0 || ~8.1.0 || ~8.2.0
Requires (Dev)
- infection/infection: ^0.26.16
- phpunit/phpunit: ^9.5.26
Suggests
None
Provides
None
Conflicts
None
Replaces
None
MIT e40b8fbeb9c0b076eedd54dae2e1b27bfad74930
- Marco Pivetta <ocramius.woop@gmail.com>
This package is auto-updated.
Last update: 2026-06-28 19:52:39 UTC
README
roave/dont is a small PHP package aimed at enforcing good
practices when it comes to designing
defensive code.
👁 Infection MSI
👁 Packagist
👁 Packagist
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
