2017 © Pedro Pelรกez
 

library rapture-validation

Rapture validation component

image

iuliann/rapture-validation

Rapture validation component

  • Thursday, June 22, 2017
  • by iuliann
  • Repository
  • 1 Watchers
  • 0 Stars
  • 19 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 46 % Grown

The README.md

Rapture PHP Validation

PhpVersion License, (*1)

Simple validation for PHP., (*2)

Requirements

  • PHP v5.4.0
  • php-date, php-filter, php-json, php-mbstring, php-pcre

Install

composer require mrjulio/rapture-validation

Quick Start

$validator = new Email();
$validator->isValid('test@gmail.com'); // true
$validator->isValid('test[at]gmail.com'); // false

$validator = new Country(Country::ISO2);
$validator->isValid('us'); // true
$validator->isValid('ux'); // false

// Group Validator
$validator = new Group([
    'email' => [
        ['required'],
        ['email', null, 'Invalid email format :value'],
    ],
    'age' => [
        ['optional'],
        ['number', null, 'Invalid age'],
        ['between', [13, 60], 'You have to be at least :min years old!'],
    ],
    'country' => [
        ['country', [Country::ISO3], 'Invalid ISO3 for country ":value"'],
    ]
]);
$validator->isValid([
    'email' => 'test@gmail.com',
    'age' => 1,
    'country' => 'xxx'
]); // false
$validator->getFirstError(); // Invalid ISO3 for country "xxx"

List of validators

Category Validator Status
Basic Optional โœ“
Required โœ“
NotEmpty โœ“
IsEmpty โœ“
NotNull โœ“
IsNull โœ“
IsTrue โœ“
IsFalse โœ“
Type โœ“
String Between โœ“
Email โœ“
Length โœ“
Url โœ“
Regex โœ“
Ip
Uuid
Comparison Between โœ“
EqualTo โœ“
NotEqualTo โœ“
IdenticalTo โœ“
NotIdenticalTo โœ“
LessThan โœ“
LessThanOrEqualTo โœ“
GreaterThan โœ“
GreaterThanOrEqualTo โœ“
Time Date
DateTime
Time
DateRange
DateTimeRange
TimeRange
Collection Choice
Group โœ“
In โœ“
Count
Unique
PropelUnique
Language
Locale โœ“
Country โœ“
File FileSize โœ“
FileType โœ“
Financial Bic
CardScheme
Currency โœ“
Luhn
Iban
Isbn
Issn
Other Callback โœ“
Username โœ“
Password โœ“
ReCaptcha โœ“
EmailDomain โœ“
Cnp โœ“

About

Author

Iulian N. rapture@iuliann.ro, (*3)

Testing

cd ./test && phpunit

License

Rapture PHP Validation is licensed under the MIT License - see the LICENSE file for details., (*4)

The Versions

22/06 2017

dev-master

9999999-dev http://rapture.iuliann.ro

Rapture validation component

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

library

22/06 2017

v1.0.1

1.0.1.0 http://rapture.iuliann.ro

Rapture validation component

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

library

15/06 2017

v1.0

1.0.0.0 http://rapture.iuliann.ro

Rapture validation component

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

library