phenixphp/validation

Phenix validation layer

0.1.0 2024-04-16 23:42 UTC

This package is auto-updated.

Last update: 2024-04-17 01:03:56 UTC


README

Latest Version on Packagist Tests Total Downloads

Phenix framework data validation layer.

Installation

You can install the package via composer:

composer require phenixphp/validation

Documentation

The official documentation for Phenix validation can be found on the Phenix framework website.

Usage

Basic example of validator usage:

use Phenix\Validation\Types\Str;
use Phenix\Validation\Validator;

$validator = new Validator();

$validator->setRules([
    'name' => Str::required()->min(3)->max(10),
    'last_name' => Str::required()->min(3)->max(10),
]);

$validator->setData([
    'name' => 'John',
    'last_name' => 'Doe',
]);

echo $validator->passes() ? 'Data is Ok' : 'Data is invalid';

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Security Vulnerabilities

If you discover a security vulnerability within Phenix, please send an e-mail to Omar Barbosa via contacto@omarbarbosa.com. All security vulnerabilities will be promptly addressed.

License

The Phenix framework is open-sourced software licensed under the MIT license.