IsStringLength
extends Base
in package
Validator base class.
Table of Contents
Properties
- $_maxLength : int
- $_minLength : int
Methods
- __construct() : void
- Constructor method to initialize the minimum and maximum lengths.
- isValid() : bool
- Returns true if validation is successful
- validate() : bool
- Abstract method to be implemented by all validators.
Properties
$_maxLength
private
int
$_maxLength
$_minLength
private
int
$_minLength
Methods
__construct()
Constructor method to initialize the minimum and maximum lengths.
public
__construct(int $min, int $max) : void
Parameters
- $min : int
-
The minimum length.
- $max : int
-
The maximum length.
isValid()
Returns true if validation is successful
public
isValid(mixed $value) : bool
Parameters
- $value : mixed
Return values
boolvalidate()
Abstract method to be implemented by all validators.
protected
validate(mixed $value) : bool
Parameters
- $value : mixed