PHP validators for RFC compliance

v1.1.0 2015-03-04 23:55 UTC

This package is not auto-updated.

Last update: 2024-02-17 11:27:47 UTC


Build Status Code Climate documentation

A PHP validators package to test RFC's compliance.


All validators must implement the \Validator\ValidatorInterface which defines two methods:

  • validate( thing ) which must return a boolean value indicating if thing passes the validation test
  • sanitize( thing ) which must return a sanitized version of thing that must pass the validation test

Example usage of the \Validator\EmailValidator (use the same process for each validator):

$thing = '';

$v = new \Validator\EmailValidator();
if ($v->validate($thing)) {
    // $thing is OK ...

} else {
    // $thing is KO ...

    $new_thing = $v->sanitize($thing);
    // $new_thing must be OK ...


For a complete information about how to install this package and load its namespace, please have a look at our USAGE documentation.

If you are a Composer user, just add the package to the requirements of your project's composer.json manifest file:

"atelierspierrot/validators": "@stable"

You can use a specific release or the latest release of a major version using the appropriate version constraint.

Author & License


Copyright (c) 2013-2016 Pierre Cassat and contributors

Licensed under the Apache 2.0 license.

Les Ateliers Pierrot - Paris, France -