Oihana PHP System

AbstractRangeRule extends Rule

AbstractYes

Base class for validation rules ensuring a numeric value lies within a specific range.

Extend this class to implement specific range-based validation rules, e.g. latitude, longitude, or bounded numeric limits.

Subclasses must define:

  • protected float|int $min (the lower bound)
  • protected float|int $max (the upper bound)
Tags
since
1.0.0

Table of Contents

Properties

$max  : float|int
Upper numeric bound (inclusive).
$message  : string
Default message template.
$min  : float|int
Lower numeric bound (inclusive).

Methods

check()  : bool
Check if the given value lies within the defined range.
getMax()  : float|int
Gets the maximum bound.
getMin()  : float|int
Gets the minimum bound.

Properties

$message

Default message template.

protected string $message = 'The :attribute must be between :min and :max.'

Methods

check()

Check if the given value lies within the defined range.

public check(mixed $value) : bool
Parameters
$value : mixed
Return values
bool

getMax()

Gets the maximum bound.

public getMax() : float|int
Return values
float|int

getMin()

Gets the minimum bound.

public getMin() : float|int
Return values
float|int

        
On this page

Search results