Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
MediaWiki\Extension\Translate\Validation\ValidatorFactory Class Reference

A factory class used to instantiate instances of pre-provided Validators. More...

Static Public Member Functions

static get ( $id, $params=null)
 Returns a validator instance based on the id specified.
 
static loadInstance ( $class, $params=null)
 Takes a Validator class name, and returns an instance of that class.
 

Detailed Description

A factory class used to instantiate instances of pre-provided Validators.

Author
Abijeet Patro @license GPL-2.0-or-later
Since
2019.06

Definition at line 37 of file ValidatorFactory.php.

Member Function Documentation

◆ get()

static MediaWiki\Extension\Translate\Validation\ValidatorFactory::get ( $id,
$params = null )
static

Returns a validator instance based on the id specified.

Parameters
string$idId of the pre-defined validator class
mixed | null$params
Exceptions
InvalidArgumentException
Returns
MessageValidator

Definition at line 78 of file ValidatorFactory.php.

◆ loadInstance()

static MediaWiki\Extension\Translate\Validation\ValidatorFactory::loadInstance ( $class,
$params = null )
static

Takes a Validator class name, and returns an instance of that class.

Parameters
string$classCustom validator class name
mixed | null$params
Exceptions
InvalidArgumentException
Returns
MessageValidator

Definition at line 106 of file ValidatorFactory.php.


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