Pickles Framework Documentation

Min
in package
implements ValidationRule

Validation rule to ensure a value meets a minimum requirement.

Implements the ValidationRule interface to provide logic for validating that a given value is not less than a specified minimum.

Table of Contents

Interfaces

ValidationRule
Interface ValidationRule

Properties

$min  : int
$minLength  : int

Methods

__construct()  : mixed
message()  : string
Returns the validation error message.
validate()  : bool
Validates the given field against the provided data.

Properties

$min

private int $min

$minLength

private int $minLength

Methods

__construct()

public __construct(int $minLength) : mixed
Parameters
$minLength : int

message()

Returns the validation error message.

public message() : string
Tags
inheritDoc
Return values
string

The error message indicating the field must be a number.

validate()

Validates the given field against the provided data.

public validate(string $field, array<string|int, mixed> $data) : bool
Parameters
$field : string

The name of the field to validate.

$data : array<string|int, mixed>

The data array containing the field and its value.

Return values
bool

Returns true if the validation passes, otherwise false.


        
On this page

Search results