2017 © Pedro Peláez
 

library validator

Flexible and highly usable validation library with no dependencies.

image

particle/validator

Flexible and highly usable validation library with no dependencies.

  • Tuesday, January 30, 2018
  • by berry__
  • Repository
  • 12 Watchers
  • 197 Stars
  • 82,148 Installations
  • PHP
  • 11 Dependents
  • 0 Suggesters
  • 34 Forks
  • 15 Open issues
  • 27 Versions
  • 13 % Grown

The README.md

image

Travis-CI Packagist Packagist downloads Scrutinizer Scrutinizer, (*1)

Particle\Validator is a very small validation library, with the easiest and most usable API we could possibly create., (*2)

Install

To easily include Particle\Validator into your project, install it via composer using the command line:, (*3)

composer require particle/validator

Small usage example

use Particle\Validator\Validator;

$v = new Validator;

$v->required('user.first_name')->lengthBetween(2, 50)->alpha();
$v->required('user.last_name')->lengthBetween(2, 50)->alpha();
$v->required('newsletter')->bool();

$result = $v->validate([
    'user' => [
        'first_name' => 'John',
        'last_name' => 'D',
    ],
    'newsletter' => true,
]);

$result->isValid(); // bool(false).
$result->getMessages();
/**
 * array(1) {
 *     ["user.last_name"]=> array(1) {
 *         ["Length::TOO_SHORT"]=> string(53) "last_name is too short and must be 2 characters long."
 *     }
 * }
 */

Functional features

  • Validate an array of data
  • Get an array of error messages
  • Overwrite the default error messages on rules, or error messages on specific values
  • Get the validated values of an array
  • Validate different contexts (insert, update, etc.) inheriting validations of the default context
  • A large set of default validation rules
  • Ability to extend the validator to add your own custom rules

Non functional features

  • Easy to write (IDE auto-completion for easy development)
  • Easy to read (improves peer review)
  • Ability to separate controller and view logic
  • Fully documented: validator.particle-php.com
  • Fully tested: Scrutinizer
  • Zero dependencies

===, (*4)

Find more information and advanced usage examples at validator.particle-php.com, (*5)

The Versions

30/01 2018

dev-master

9999999-dev http://github.com/particle-php/validator

Flexible and highly usable validation library with no dependencies.

  Sources   Download

BSD BSD-3-Clause

The Requires

  • php >=5.4

 

The Development Requires

by Berry Langerak

validator validation

30/01 2018

v2.3.2

2.3.2.0 http://github.com/particle-php/validator

Flexible and highly usable validation library with no dependencies.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4

 

The Development Requires

by Berry Langerak

validator validation

30/01 2018

v1.0.x-dev

1.0.9999999.9999999-dev http://github.com/particle-php/validator

Flexible and highly usable validation library with no dependencies.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.2

 

The Development Requires

by Berry Langerak

validator validation

18/01 2018

v2.3.1

2.3.1.0 http://github.com/particle-php/validator

Flexible and highly usable validation library with no dependencies.

  Sources   Download

BSD

The Requires

  • php >=5.4

 

The Development Requires

by Berry Langerak

validator validation

21/07 2017

v2.3.0

2.3.0.0 http://github.com/particle-php/validator

Flexible and highly usable validation library with no dependencies.

  Sources   Download

BSD

The Requires

  • php >=5.4

 

The Development Requires

by Berry Langerak

validator validation

14/10 2016

dev-feature/readme-branch-clarification

dev-feature/readme-branch-clarification http://github.com/particle-php/validator

Flexible and highly usable validation library with no dependencies.

  Sources   Download

BSD

The Requires

  • php >=5.4

 

The Development Requires

by Berry Langerak

validator validation

05/08 2016

v2.2.0

2.2.0.0 http://github.com/particle-php/validator

Flexible and highly usable validation library with no dependencies.

  Sources   Download

BSD

The Requires

  • php >=5.4

 

The Development Requires

by Berry Langerak

validator validation

05/08 2016

v2.1.1

2.1.1.0 http://github.com/particle-php/validator

Flexible and highly usable validation library with no dependencies.

  Sources   Download

BSD

The Requires

  • php >=5.4

 

The Development Requires

by Berry Langerak

validator validation

17/03 2016

v2.1.0

2.1.0.0 http://github.com/particle-php/validator

Flexible and highly usable validation library with no dependencies.

  Sources   Download

BSD

The Requires

 

The Development Requires

by Berry Langerak

validator validation

14/03 2016

v2.0.1

2.0.1.0 http://github.com/particle-php/validator

Flexible and highly usable validation library with no dependencies.

  Sources   Download

BSD

The Requires

  • php >=5.4

 

The Development Requires

by Berry Langerak

validator validation

30/10 2015

v2.0.0

2.0.0.0 http://github.com/particle-php/validator

Flexible and highly usable validation library with no dependencies.

  Sources   Download

BSD

The Requires

  • php >=5.4

 

The Development Requires

by Berry Langerak

validator validation

30/10 2015

1.0.x-dev

1.0.9999999.9999999-dev http://github.com/particle-php/validator

Flexible and highly usable validation library with no dependencies.

  Sources   Download

BSD

The Requires

  • php >=5.3.2

 

The Development Requires

by Berry Langerak

validator validation

30/10 2015

v1.0.6

1.0.6.0 http://github.com/particle-php/validator

Flexible and highly usable validation library with no dependencies.

  Sources   Download

BSD

The Requires

  • php >=5.3.2

 

The Development Requires

by Berry Langerak

validator validation

23/09 2015

v2.0.0-alpha.2

2.0.0.0-alpha2 http://github.com/particle-php/validator

Flexible and highly usable validation library with no dependencies.

  Sources   Download

BSD

The Requires

  • php >=5.4

 

The Development Requires

by Berry Langerak

validator validation

26/08 2015

2.0.0-alpha.1

2.0.0.0-alpha1 http://github.com/particle-php/validator

Flexible and highly usable validation library with no dependencies.

  Sources   Download

BSD

The Requires

  • php >=5.4

 

The Development Requires

by Berry Langerak

validator validation

30/06 2015

v1.0.5

1.0.5.0 http://github.com/particle-php/validator

Flexible and highly usable validation library with no dependencies.

  Sources   Download

BSD

The Requires

  • php >=5.3.2

 

The Development Requires

by Berry Langerak

validator validation

19/06 2015

v1.0.4

1.0.4.0 http://github.com/particle-php/validator

Flexible and highly usable validation library with no dependencies.

  Sources   Download

BSD

The Requires

  • php >=5.3.2

 

The Development Requires

by Berry Langerak

validator validation

19/06 2015

v1.0.3

1.0.3.0 http://github.com/particle-php/validator

Flexible and highly usable validation library with no dependencies.

  Sources   Download

BSD

The Requires

  • php >=5.3.2

 

The Development Requires

by Berry Langerak

validator validation

04/06 2015

v1.0.2

1.0.2.0 http://github.com/particle-php/validator

Flexible and highly usable validation library with no dependencies.

  Sources   Download

BSD

The Requires

  • php >=5.3.2

 

The Development Requires

by Berry Langerak

validator validation

01/06 2015

v1.0.1

1.0.1.0 http://github.com/particle-php/validator

Flexible and highly usable validation library with no dependencies.

  Sources   Download

BSD

The Requires

  • php >=5.3.2

 

The Development Requires

by Berry Langerak

validator validation

31/05 2015

v1.0.0

1.0.0.0 http://github.com/particle-php/validator

Flexible and highly usable validation library with no dependencies.

  Sources   Download

BSD

The Requires

  • php >=5.3.2

 

The Development Requires

by Berry Langerak

validator validation

22/05 2015

v0.4.2

0.4.2.0 http://github.com/particle-php/validator

Flexible and highly usable validation library with no dependencies.

  Sources   Download

BSD

The Requires

  • php >=5.3.2

 

The Development Requires

by Berry Langerak

validator validation

20/05 2015

v0.4.1

0.4.1.0 http://github.com/particle-php/validator

Flexible and highly usable validation library with no dependencies.

  Sources   Download

BSD

The Requires

  • php >=5.3.2

 

The Development Requires

by Berry Langerak

validator validation

20/05 2015

v0.4.0

0.4.0.0 http://github.com/particle-php/validator

Flexible and highly usable validation library with no dependencies.

  Sources   Download

BSD

The Requires

  • php >=5.3.2

 

The Development Requires

by Berry Langerak

validator validation

12/04 2015

v0.3.0

0.3.0.0 http://github.com/particle-php/validator

Flexible and highly usable validation library with no dependencies.

  Sources   Download

BSD

The Requires

  • php >=5.3.2

 

The Development Requires

by Berry Langerak

validator validation

06/04 2015

v0.2.0

0.2.0.0 http://github.com/particle-php/validator

Flexible and highly usable validation library with no dependencies.

  Sources   Download

BSD

The Requires

  • php >=5.3.2

 

The Development Requires

by Berry Langerak

validator validation

31/03 2015

v0.1.0

0.1.0.0 http://github.com/particle-php/validator

Flexible and highly usable validation library with no dependencies.

  Sources   Download

BSD

The Requires

  • php >=5.3.2

 

The Development Requires

by Berry Langerak

validator validation