Wikibase
MediaWiki Wikibase extension
Wikibase\Repo\Validators\NumberRangeValidator Class Reference

NumberRangeValidator checks that a numerical value is in a given range. More...

+ Inheritance diagram for Wikibase\Repo\Validators\NumberRangeValidator:
+ Collaboration diagram for Wikibase\Repo\Validators\NumberRangeValidator:

Public Member Functions

 __construct ( $min, $max)
 
 validate ( $value)
 
 setOptions (array $options)
 

Private Attributes

 $min
 
 $max
 

Detailed Description

NumberRangeValidator checks that a numerical value is in a given range.

Author
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Validators\NumberRangeValidator::__construct (   $min,
  $max 
)
Parameters
int | float$min
int | float$max

Member Function Documentation

◆ setOptions()

Wikibase\Repo\Validators\NumberRangeValidator::setOptions ( array  $options)
See also
ValueValidator::setOptions()
Parameters
array$options

◆ validate()

Wikibase\Repo\Validators\NumberRangeValidator::validate (   $value)
See also
ValueValidator::validate()
Parameters
int | float$valueThe numeric value to validate
Returns
Result

Member Data Documentation

◆ $max

Wikibase\Repo\Validators\NumberRangeValidator::$max
private

◆ $min

Wikibase\Repo\Validators\NumberRangeValidator::$min
private

The documentation for this class was generated from the following file: