\Omega\Validation\Rule MinRule

Min rule class.

The MinRule class is responsible for validating whether a given input string has a minimum length. It checks if the input is empty and, if not, compares its length with the specified minimum length parameter. If the input is empty, it is considered valid.

Summary

Methods
Properties
Constants
validate
getMessage
No public properties found
No public constants found
No protected methods found
No protected properties found
No protected constants found
No private methods found
No private properties found
No private constants found

Methods

validate()

validate(array  $data, string  $field, string[]  $params) : string|bool

Validate the rule.

Parameters

array $data

Holds array of data.

string $field

Holds the name of the field being validated.

string[] $params

Holds an array of parameters (not used for this rule).

Returns

string|bool —

Returns true if validation is successful (valid integer format), or an error message if the validation fails.

getMessage()

getMessage(array  $data, string  $field, string[]  $params) : string

Get the validation error message.

Parameters

array $data

Holds an array of data.

string $field

Holds the name of the field that failed validation.

string[] $params

Holds an array of parameters (not used for this rule).

Returns

string —

Returns the error message indicating that the field should be in a valid integer format.