Wikibase
MediaWiki Wikibase extension
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 ( $value)
 
 formatEntityId (EntityId $entityId)
 
 formatSiteLink (SiteLink $link)
 

Private Attributes

 $dataValueFormatter
 
 $entityIdFormatter
 
 $sites
 
 $language
 
 $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
Parameters
EntityId$entityId
Returns
string The formatted ID (as a wikitext link).

◆ formatObject()

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

◆ formatSiteLink()

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

◆ formatValueList()

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

Member Data Documentation

◆ $dataValueFormatter

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

◆ $entityIdFormatter

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

◆ $language

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

◆ $sites

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

◆ $valueLocalizer

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

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