2017 © Pedro Peláez
 

library validation

Rudra framework

image

rudra/validation

Rudra framework

  • Tuesday, June 5, 2018
  • by jagepard
  • Repository
  • 1 Watchers
  • 1 Stars
  • 117 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 2 % Grown

The README.md

PHPunit Maintainability CodeFactor, (*1)

Coverage Status

Rudra-Validation | API

Install / Установка

composer require rudra/validation

Example of usage / Пример использования

use Rudra\Validation\ValidationFacade;

$_SESSION['csrf'][] = '123456';

$processed = [
    'set_without_validation' => ValidationFacade::set('set_without_validation')->run();
    'set_with_data_clearing' => ValidationFacade::sanitize(' 

String, (*2)

')->run(); 'required' => ValidationFacade::set('required')->required()->run(), 'integer' => ValidationFacade::set(12345)->required()->integer()->run(), 'minimum' => ValidationFacade::set('12345')->required()->min(5)->run(); 'maximum' => ValidationFacade::set('12345')->required()->max(5)->run(); 'equals' => ValidationFacade::set('12345')->equals('12345')->run(); 'email' => ValidationFacade::email('user@example.com')->run(); 'csrf' => ValidationFacade::set('123456')->csrf($_SESSION['csrf'])->run(); ];

Data is validated in a chain\ Данные проверяются по цепочке, (*3)

For example / Например

ValidationFacade::sanitize(' 

12345, (*4)

')->required()->min(3)->max(10)->equals('12345')->run(); ValidationFacade::email('user@example.com')->max(25)->run();

Data validation check / Проверка валидности данных

if (ValidationFacade::approve($processed)) {
    $validated = ValidationFacade::getValidated($processed, ["csrf", "_method"]);
}
getValidated

Gets an array of validated data excluding the keys ["csrf", "_method"]\ Получает массив проверенных данных исключая ключи ["csrf", "_method"], (*5)

Get all error messages / Получить все сообщения об ошибках

ValidationFacade::getAlerts($processed, ['required']);
getAlerts

Gets an array with error messages excluding the keys ['required']\ Получает массив с сообщениями об ошибках исключая ключи ['required'], (*6)

The Versions

05/06 2018

dev-master

9999999-dev

Rudra framework

  Sources   Download

MIT GPL-3.0-or-later

The Requires

 

The Development Requires

validator validation rudra validation-library

05/06 2018

v2.0.0

2.0.0.0

Rudra framework

  Sources   Download

GPL-3.0-or-later

The Requires

 

The Development Requires

validator validation rudra validation-library

21/04 2017

1.2.0

1.2.0.0

The Rudra framework

  Sources   Download

MIT

The Requires

 

The Development Requires

validator validation rudra validation-library

10/04 2017

1.1.0

1.1.0.0

The Rudra framework

  Sources   Download

MIT

The Requires

 

The Development Requires

validation rudra

03/04 2017

1.0.0

1.0.0.0

The Rudra framework

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

validation rudra