psx/validate

Validate data through a filter system

v1.0.0 2016-05-08 10:25 UTC

README

About

Validation library which validates arbitrary data using a flxeible filter system.

Usage

<?php

$validate = new Validate();
$result   = $validate->validate($data, Validate::TYPE_STRING, [new Filter\Alnum(), new Filter\Length(3, 255)]);

if ($result->isSuccessful()) {
    echo 'Valid!';
} else {
    echo implode(', ', $result->getErrors());
}