phpolar/validators

A set of property validators

1.2.0 2023-09-02 18:11 UTC

This package is auto-updated.

Last update: 2024-10-28 01:00:52 UTC


README

Phpolar Logo

Validators

A set of property validators.

Version PHP Version Require License Total Downloads PHPMD PHP Composer

Usage

class Something
{
    #[Required]
    #[Pattern("/^[A-Za-z]$/")]
    public string $name;

    #[Max(12)]
    #[Min(2)]
    public int $age;
}


$validationAttr->isValid();