Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Roave/Dont
:no_entry_sign: Small set of defensive programming utilities/traits for PHP
https://github.com/Roave/Dont
Last synced: 3 months ago
JSON representation
:no_entry_sign: Small set of defensive programming utilities/traits for PHP
- Host: GitHub
- URL: https://github.com/Roave/Dont
- Owner: Roave
- License: mit
- Created: 2016-10-11T02:22:45.000Z (about 8 years ago)
- Default Branch: 1.7.x
- Last Pushed: 2024-08-02T05:06:57.000Z (3 months ago)
- Last Synced: 2024-08-02T06:27:16.654Z (3 months ago)
- Language: PHP
- Homepage:
- Size: 216 KB
- Stars: 399
- Watchers: 13
- Forks: 21
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Don't
`roave/dont` is a small PHP package aimed at enforcing good
practices when it comes to designing
[defensive code](https://ocramius.github.io/extremely-defensive-php/).[![Infection MSI](https://badge.stryker-mutator.io/github.com/Roave/Dont/1.2.x)](https://infection.github.io)
[![Packagist](https://img.shields.io/packagist/v/roave/dont.svg)](https://packagist.org/packages/roave/dont)
[![Packagist](https://img.shields.io/packagist/vpre/roave/dont.svg)](https://packagist.org/packages/roave/dont)## Installation
```sh
composer require roave/dont
```## Usage
The package currently provides the following traits:
* [`Dont\DontDeserialise`](docs/DontDeserialise.md)
* [`Dont\DontSerialise`](docs/DontSerialise.md)
* [`Dont\DontClone`](docs/DontClone.md)
* [`Dont\DontGet`](docs/DontGet.md)
* [`Dont\DontSet`](docs/DontSet.md)
* [`Dont\DontCall`](docs/DontCall.md)
* [`Dont\DontCallStatic`](docs/DontCallStatic.md)
* [`Dont\DontToString`](docs/DontToString.md)
* [`Dont\JustDont`](docs/JustDont.md)
* [`Dont\DontInstantiate`](docs/DontInstantiate.md)Usage is straightforward:
```php
use Dont\DontSerialise;class MyClass
{
use DontSerialise;
}serialize(new MyClass); // will throw an exception
```