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

ValueFormatter for formatting objects that may be encountered in parameters of ValueValidators\Error objects as wikitext. More...

+ Inheritance diagram for Wikibase\Repo\Localizer\MessageParameterFormatter:
+ Collaboration diagram for Wikibase\Repo\Localizer\MessageParameterFormatter:

Public Member Functions

 __construct (ValueFormatter $dataValueFormatter, EntityIdFormatter $entityIdFormatter, SiteLookup $sites, Language $language)
 
 format ( $value)
 

Private Member Functions

 formatValueList (array $values)
 
 formatObject (object $value)
 
 formatEntityId (EntityId $entityId)
 
 formatSiteLink (SiteLink $link)
 

Private Attributes

ValueFormatter $dataValueFormatter
 
EntityIdFormatter $entityIdFormatter
 
SiteLookup $sites
 
Language $language
 
NumberLocalizer $valueLocalizer
 

Detailed Description

ValueFormatter for formatting objects that may be encountered in parameters of ValueValidators\Error objects as wikitext.

Author
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Localizer\MessageParameterFormatter::__construct ( ValueFormatter $dataValueFormatter,
EntityIdFormatter $entityIdFormatter,
SiteLookup $sites,
Language $language )
Parameters
ValueFormatter$dataValueFormatterA formatter for turning DataValues into wikitext.
EntityIdFormatter$entityIdFormatterAn entity id formatter returning wikitext.
SiteLookup$sites
Language$language

Member Function Documentation

◆ format()

Wikibase\Repo\Localizer\MessageParameterFormatter::format ( $value)
See also
ValueFormatter::format
Parameters
mixed$valueThe value to format
Returns
string The formatted value (as wikitext).
Exceptions
FormattingException

◆ formatEntityId()

Wikibase\Repo\Localizer\MessageParameterFormatter::formatEntityId ( EntityId $entityId)
private
Returns
string The formatted ID (as a wikitext link).

◆ formatObject()

Wikibase\Repo\Localizer\MessageParameterFormatter::formatObject ( object $value)
private
Returns
string The formatted value (as wikitext).

◆ formatSiteLink()

Wikibase\Repo\Localizer\MessageParameterFormatter::formatSiteLink ( SiteLink $link)
private
Returns
string The formatted link (as a wikitext link).

◆ formatValueList()

Wikibase\Repo\Localizer\MessageParameterFormatter::formatValueList ( array $values)
private

Member Data Documentation

◆ $dataValueFormatter

ValueFormatter Wikibase\Repo\Localizer\MessageParameterFormatter::$dataValueFormatter
private

◆ $entityIdFormatter

EntityIdFormatter Wikibase\Repo\Localizer\MessageParameterFormatter::$entityIdFormatter
private

◆ $language

Language Wikibase\Repo\Localizer\MessageParameterFormatter::$language
private

◆ $sites

SiteLookup Wikibase\Repo\Localizer\MessageParameterFormatter::$sites
private

◆ $valueLocalizer

NumberLocalizer Wikibase\Repo\Localizer\MessageParameterFormatter::$valueLocalizer
private

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