Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Repo\ValueParserFactory Class Reference

Builds ValueParser objects. More...

Public Member Functions

 __construct (array $valueParsers)
 
 getParserIds ()
 Returns the ValueParser identifiers.
 
 newParser ( $parserId, ParserOptions $parserOptions)
 Returns an instance of the ValueParser with the provided id or null if there is no such ValueParser.
 

Private Member Functions

 instantiateParser ( $builder, ParserOptions $options)
 

Private Attributes

 $parsers = []
 

Detailed Description

Builds ValueParser objects.

Author
Jeroen De Dauw < jeroe.nosp@m.nded.nosp@m.auw@g.nosp@m.mail.nosp@m..com >
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\ValueParserFactory::__construct ( array  $valueParsers)
Parameters
callable[]$valueParsersAn associative array mapping parser ids to factory functions.
Exceptions
InvalidArgumentException

Member Function Documentation

◆ getParserIds()

Wikibase\Repo\ValueParserFactory::getParserIds ( )

Returns the ValueParser identifiers.

Returns
string[]

◆ instantiateParser()

Wikibase\Repo\ValueParserFactory::instantiateParser (   $builder,
ParserOptions  $options 
)
private
Parameters
callable$builderA callable that returns a ValueParser. $options will be passed to the constructor or callable, respectively.
ParserOptions$options
Exceptions
LogicExceptionif the builder did not create a ValueParser
Returns
ValueParser

◆ newParser()

Wikibase\Repo\ValueParserFactory::newParser (   $parserId,
ParserOptions  $parserOptions 
)

Returns an instance of the ValueParser with the provided id or null if there is no such ValueParser.

Parameters
string$parserId
ParserOptions$parserOptions
Exceptions
OutOfBoundsExceptionIf no parser was registered for $parserId
Returns
ValueParser

Member Data Documentation

◆ $parsers

Wikibase\Repo\ValueParserFactory::$parsers = []
private

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