phpolar/validators

A set of property validators

1.2.0 2023-09-02 18:11 UTC

This package is auto-updated.

Last update: 2024-12-09 04:08:49 UTC


README

Phpolar Logo

Validators

A set of property validators.

Version PHP Version Require 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();