2017 © Pedro Peláez
 

library affirm

A simple validation library for PHP 5.4+

image

hassankhan/affirm

A simple validation library for PHP 5.4+

  • Thursday, February 5, 2015
  • by hassankhan
  • Repository
  • 1 Watchers
  • 4 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Affirm

Latest version ![Software License][ico-license] Build Status ![Coverage Status][ico-scrutinizer] Quality Score ![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)

Install

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)

Contributing

Please see CONTRIBUTING.md for details., (*11)

Credits

License

The MIT License (MIT). Please see LICENSE.md for more information., (*12)

The Versions

05/02 2015

dev-master

9999999-dev https://github.com/hassankhan/affirm

A simple validation library for PHP 5.4+

  Sources   Download

MIT

The Requires

 

The Development Requires

validation