PHP Class Bluz\Validator\Rule\Ip

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

Protected Properties

Property Type Description
$networkRange network range
$options setup options

Public Methods

Method Description
__construct ( mixed $options = null ) Setup validation rule
getTemplate ( ) : string Get error template
validate ( string $input ) : boolean Check input data

Protected Methods

Method Description
belongsToSubnet ( string $input ) : boolean Check subnet
fillAddress ( string &$input, string $char = '*' ) Fill address
parseRange ( string $input ) : array Parse IP range
parseRangeUsingCidr ( string $input, array &$range ) Parse range using Classless Inter-Domain Routing (CIDR)
parseRangeUsingWildcards ( string $input, array &$range ) Parse range using wildcards
verifyAddress ( string $address ) : boolean Verify IP address
verifyNetwork ( string $input ) : boolean Verify Network by mask

Method Details

__construct() public method

Setup validation rule
public __construct ( mixed $options = null )
$options mixed

belongsToSubnet() protected method

Check subnet
protected belongsToSubnet ( string $input ) : boolean
$input string
return boolean

fillAddress() protected method

Fill address
protected fillAddress ( string &$input, string $char = '*' )
$input string
$char string

getTemplate() public method

Get error template
public getTemplate ( ) : string
return string

parseRange() protected method

Parse IP range
protected parseRange ( string $input ) : array
$input string
return array

parseRangeUsingCidr() protected method

Parse range using Classless Inter-Domain Routing (CIDR)
protected parseRangeUsingCidr ( string $input, array &$range )
$input string
$range array

parseRangeUsingWildcards() protected method

Parse range using wildcards
protected parseRangeUsingWildcards ( string $input, array &$range )
$input string
$range array

validate() public method

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

verifyAddress() protected method

Verify IP address
protected verifyAddress ( string $address ) : boolean
$address string
return boolean

verifyNetwork() protected method

Verify Network by mask
protected verifyNetwork ( string $input ) : boolean
$input string
return boolean

Property Details

$networkRange protected property

network range
protected $networkRange

$options protected property

setup options
protected $options