dev-master
9999999-dev https://github.com/hassankhan/affirmA simple validation library for PHP 5.4+
MIT
The Requires
- php >=5.4.0
- hassankhan/frontman ~0.1
The Development Requires
by Hassan Khan
validation
A simple validation library for PHP 5.4+
![Software License][ico-license]
![Coverage Status][ico-scrutinizer]
![Total Downloads][ico-downloads], (*1)
Affirm is a simple, no-frills assertion/validation package written for PHP 5.4+. It is a PHP port of is.js., (*2)
It is quite similar to Assert, and aims to match it., (*3)
Via Composer, (*4)
``` bash $ composer require hassankhan/affirm, (*5)
## Usage First instantiate the class: ```php $affirm = new Affirm\Affirm()
You can use either Affirm::is()
or Affirm::are()
to pass in any values:, (*6)
$affirm->is(25, 50, 75); $affirm->are(25, 50, 75);
Once all values have been passed in, you can use a modifier. By default, Affirm will only return true
if all values pass the test, you can change this like so:, (*7)
$affirm->is(25, 50, 75)->any();
Then add your test:, (*8)
$affirm->is(25, 50, 75)->any()->odd();
You can also use Affirm as a static class:, (*9)
Affirm\Proxy::is(25, 50, 75)->any()->odd();
Please read the API documentation for a full list of available methods., (*10)
Please see CONTRIBUTING.md for details., (*11)
The MIT License (MIT). Please see LICENSE.md for more information., (*12)
A simple validation library for PHP 5.4+
MIT
validation