roave / dont
A small set of traits that can be used to prevent misuse of your objects
Installs: 256 828
Dependents: 5
Suggesters: 0
Security: 0
Stars: 399
Watchers: 11
Forks: 21
Open Issues: 11
pkg:composer/roave/dont
Requires
- php: ~8.0.0 || ~8.1.0 || ~8.2.0
Requires (Dev)
- infection/infection: ^0.26.16
- phpunit/phpunit: ^9.5.26
- 1.7.x-dev
- 1.6.x-dev
- 1.6.0
- 1.5.x-dev
- 1.5.0
- 1.4.x-dev
- 1.4.0
- 1.3.x-dev
- 1.3.0
- 1.2.x-dev
- 1.2.0
- 1.1.x-dev
- 1.1.0
- 1.0.0
- dev-renovate/all-minor-patch
- dev-renovate/packagist-phpunit-phpunit-vulnerability
- dev-dependabot/composer/phpunit/phpunit-9.6.33
- dev-renovate/phpunit-phpunit-12.x
- dev-renovate/lock-file-maintenance
- dev-renovate/actions-checkout-6.x
This package is auto-updated.
Last update: 2026-01-28 00:38:24 UTC
README
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 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