Skip to content

⚡ Php validator (bool, int, float, number, string, email, uri)

License

Notifications You must be signed in to change notification settings

teodoroleckie/validator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Php validator (bool, int, float, number, string, email, uri)

Scrutinizer Code Quality Code Intelligence Status Build Status

Installation

You can install the package via composer:

composer require tleckie/validator
<?php

require "vendor/autoload.php";

use Tleckie\Validator\ValidatorFactory;

$validator = new ValidatorFactory();

$validator->boolValidator()->isValid('true'); // false

$validator->emailValidator()->isValid('[email protected]'); // true

$validator->floatValidator()->isValid(1.22); // true

$validator->intValidator()->isValid(1.22); // false

$validator->numericValidator()->isValid(1.22); // true

$validator->stringValidator()->isValid("1.22"); // true

$validator->uriValidator()->isValid("https://hostname.dev/path/"); // true