tleckie/validator

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

1.0.4 2021-05-18 14:03 UTC

This package is auto-updated.

Last update: 2024-12-20 19:39:01 UTC


README

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@gmail.com'); // 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