library php-validate
A Java Bean Validation based for PHP
jfernando/php-validate
A Java Bean Validation based for PHP
- Friday, April 27, 2018
- by jfernandomota
- Repository
- 1 Watchers
- 0 Stars
- 127 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 1 Forks
- 0 Open issues
- 2 Versions
- 3 % Grown
PHP Validations
A set of tools for validations with PHP., (*1)
Introduction
This library offers tools for validations of many kinds of problem:, (*2)
-
ValidatorVerifier
A set of tools for object validations based in annotations, having inspiration in Java Beans Validations
-
Transformation
A object transformation based in annotations
-
MapValidate
A simple set of tools for validate associative array
-
Schema
A set of tools for validate associative array, schema based, inspirated in hapijs/joi
ValidatorVerifier
MapValidate
Schema
$schema = Schema::schema([
'name' => Schema::string()->min(3)->max(80),
'address' => Schema::schema([
'street' => Schema::string()->min(3)->max(50)
'number' => Schema::numeric(['code' => 'invalid_number', 'message' => 'Invalid number']),
'other' => Schema::string()->required(false) // Optional field
]),
'projects' => Schema::array()->schema([
'name' => Schema::string()
])
]);
$errors = $schema->getErrors($data);
$errors->isValid(); // true | false
$errors->getErrors(); //
This library is expansive for use custom validations, (*3)
dev-master
9999999-dev
A Java Bean Validation based for PHP
Sources
Download
The Requires
The Development Requires
by
Jorge Fernando
1
1.0.0.0
A Java Bean Validation based for PHP
Sources
Download
The Requires
The Development Requires
by
Jorge Fernando