# Collection+Json Validations Array Extension
[![license](https://img.shields.io/github/license/breaker1/collectionjson-validationsarrayextension.svg?style=for-the-badge)](https://packagist.org/packages/breaker1/collectionjson-validationsarrayextension)
[![Packagist Version](https://img.shields.io/packagist/v/breaker1/collectionjson-validationsarrayextension.svg?style=for-the-badge)](https://packagist.org/packages/breaker1/collectionjson-validationsarrayextension)
[![Build Status](https://img.shields.io/travis/breaker1/collectionjson-validationsarrayextension.svg?style=for-the-badge)](https://travis-ci.org/breaker1/collectionjson-validationsarrayextension)
[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/breaker1/collectionjson-validationsarrayextension.svg?style=for-the-badge)](https://scrutinizer-ci.com/g/breaker1/collectionjson-validationsarrayextension/?branch=master)
[![Code Quality](https://img.shields.io/scrutinizer/g/breaker1/collectionjson-validationsarrayextension.svg?style=for-the-badge)](https://scrutinizer-ci.com/g/breaker1/collectionjson-validationsarrayextension/)
[![SensioLabs Insight](https://img.shields.io/sensiolabs/i/b82db368-2f12-47ab-a6aa-1859f9b8c460.svg?style=for-the-badge)](https://insight.sensiolabs.com/projects/b82db368-2f12-47ab-a6aa-1859f9b8c460)

An addon for [kkamkou/collection-json.php](https://packagist.org/packages/kkamkou/collection-json.php) to add the validations array extensions

See the [official validations extension documentation](https://github.com/collection-json/extensions/blob/master/validation_array.md)
for more information about validations and examples.

## Example
```php
use CollectionJson\Collection;
use CollectionJson\Property;
use Breaker1\CollectionJson\Property\Data;
use Breaker1\CollectionJson\Property\Validation;

$validation = new Validation("presence"); // Given Name is required
$data = new Data("givenName", null, "First Name");
$data->addValidation($validation);
```

## Signatures
```php
\Breaker1\CollectionJson\Property\Data($name, $value = null, $prompt = null, $validations = []);
\Breaker1\CollectionJson\Property\Validation($name, $prompt = null, $arguments = [], $message = null);
\Breaker1\CollectionJson\Property\Validation\Argument($name, $value);
```
