/validate

A PHP validation proxy to various validate libraries.

Primary LanguagePHPMIT LicenseMIT

phossa2/validate

Build Status Code Quality Code Climate PHP 7 ready HHVM Latest Stable Version License

phossa2/validate is a PHP validation proxy to various validate libraries.

It requires PHP 5.4, supports PHP 7.0+ and HHVM. It is compliant with PSR-1, PSR-2, PSR-3, PSR-4, and the proposed PSR-5.

Installation

Install via the composer utility.

composer require "phossa2/validate"

or add the following lines to your composer.json

{
    "require": {
       "phossa2/validate": "^2.0.0"
    }
}

Usage

Create the validate instance,

use Phossa2\Validate\Validate;

$v = new Validate();

if (true === $v->validate($_POST, [
    'username' => 'required|alpha_numeric',
    'password' => 'required|max_len,100|min_len,6'
])) {
    // continue
} else {
    $err = $v->getError();
}

Change log

Please see CHANGELOG from more information.

Testing

$ composer test

Contributing

Please see CONTRIBUTE for more information.

Dependencies

  • PHP >= 5.4.0

  • phossa2/shared >= 2.0.21

  • wixel/gump >= 1.4

License

MIT License