PHP Class Bluz\Validator\Rule\Length

Inheritance: extends AbstractCompareRule
Show file Open project: bluzphp/framework Class Usage Examples

Protected Properties

Property Type Description
$maxValue maximum value
$minValue minimum value

Public Methods

Method Description
__construct ( integer | null $min = null, integer | null $max = null, boolean $inclusive = true ) Setup validation rule
getTemplate ( ) : string Get error template
validate ( string $input ) : boolean Check input data

Protected Methods

Method Description
extractLength ( string | object $input ) : integer | false Extract length

Method Details

__construct() public method

Setup validation rule
public __construct ( integer | null $min = null, integer | null $max = null, boolean $inclusive = true )
$min integer | null
$max integer | null
$inclusive boolean

extractLength() protected method

Extract length
protected extractLength ( string | object $input ) : integer | false
$input string | object
return integer | false

getTemplate() public method

Get error template
public getTemplate ( ) : string
return string

validate() public method

Check input data
public validate ( string $input ) : boolean
$input string
return boolean

Property Details

$maxValue protected property

maximum value
protected $maxValue

$minValue protected property

minimum value
protected $minValue