PHP Class Jyxo\Input\Validator\StringLengthBetween

Author: Jakub Tománek
Inheritance: extends AbstractValidator
Show file Open project: jyxo/php

Protected Properties

Property Type Description
$max integer Maximal string length.
$min integer Minimal string length.

Public Methods

Method Description
__construct ( integer $min, integer $max ) Constructor.
getMax ( ) : integer Returns the maximum string length.
getMin ( ) : integer Return the minimal string length.
isValid ( string $value ) : boolean Validates a value.
setMax ( integer $max ) : self Sets the maximal string length.
setMin ( integer $min ) : self Sets the minimal string length.

Method Details

__construct() public method

Sets both maximal and minimal string length.
public __construct ( integer $min, integer $max )
$min integer Minimal length (string length must be greater of equal)
$max integer Maximal length (string length must be less or equal)

getMax() public method

Returns the maximum string length.
public getMax ( ) : integer
return integer

getMin() public method

Return the minimal string length.
public getMin ( ) : integer
return integer

isValid() public method

Validates a value.
public isValid ( string $value ) : boolean
$value string Input value
return boolean

setMax() public method

Sets the maximal string length.
public setMax ( integer $max ) : self
$max integer Maximal string length
return self

setMin() public method

Sets the minimal string length.
public setMin ( integer $min ) : self
$min integer Minimal string length
return self

Property Details

$max protected property

Maximal string length.
protected int $max
return integer

$min protected property

Minimal string length.
protected int $min
return integer