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

An AlternativeValidator uses a list of sub-validators to validate the data. More...

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

Public Member Functions

 __construct (array $validators)
 
 validate ( $value)
 
 setOptions (array $options)
 

Private Attributes

 $validators
 

Detailed Description

An AlternativeValidator uses a list of sub-validators to validate the data.

It does not implement any validation logic directly. The AlternativeValidator considers the data to be valid if any of the inner validators accepts the data.

Author
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Validators\AlternativeValidator::__construct ( array  $validators)
Parameters
ValueValidator[]$validators

Member Function Documentation

◆ setOptions()

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

◆ validate()

Wikibase\Repo\Validators\AlternativeValidator::validate (   $value)
See also
ValueValidator::validate()
Parameters
mixed$valueThe value to validate
Returns
Result

Member Data Documentation

◆ $validators

Wikibase\Repo\Validators\AlternativeValidator::$validators
private

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