validator
class validator
| internal |
Wrapper utilities around the Respect/Validation library.
Provides a small facade to simplify validation calls across the plugin while keeping a consistent API.
Methods
Validates whether a string is a valid email address.
Validates whether a string is a valid Brazilian CPF number.
Validates whether a string is a valid Brazilian CNPJ number.
Checks if a string is not empty and meets min/max length constraints (max is optional).
Generic method to validate data against multiple rules and return error messages.
Validates whether the provided value is a valid UUID.
Details
at line 41
static bool
is_email(string $email)
Validates whether a string is a valid email address.
at line 53
static bool
validate_cpf(string $cpf)
Validates whether a string is a valid Brazilian CPF number.
at line 65
static bool
validate_cnpj(string $cnpj)
Validates whether a string is a valid Brazilian CNPJ number.
at line 79
static bool
is_not_empty(string $value, int $minLength = 1, int|null $maxLength = null)
Checks if a string is not empty and meets min/max length constraints (max is optional).
at line 92
static array
validate(mixed $data, Validatable $rules)
Generic method to validate data against multiple rules and return error messages.
at line 110
static bool
is_uuid(mixed $value)
Validates whether the provided value is a valid UUID.