Wikibase
MediaWiki Wikibase extension
|
Formatter for Summary objects. More...
Public Member Functions | |
__construct (EntityIdFormatter $idFormatter, ValueFormatter $valueFormatter, SnakFormatter $snakFormatter, Language $language, EntityIdParser $idParser) | |
formatAutoComment (FormatableSummary $summary) | |
Format the autocomment part of a full summary. | |
formatAutoSummary (FormatableSummary $summary) | |
Formats the auto summary part of a full summary. | |
formatSummary (FormatableSummary $summary) | |
Format the given summary. | |
Protected Member Functions | |
formatArgList (array $args) | |
formatArg ( $arg) | |
Format an auto summary argument. | |
formatKeyValuePairs (array $pairs) | |
Turns an associative array into a list of strings by rendering each key/value pair. | |
Private Member Functions | |
formatIfEntityId ( $value) | |
assembleSummaryString ( $autoComment, $autoSummary, $userSummary) | |
Merge the total summary. | |
Private Attributes | |
$language | |
$idFormatter | |
$valueFormatter | |
$snakFormatter | |
$idParser | |
$stringNormalizer | |
Formatter for Summary objects.
Wikibase\Repo\SummaryFormatter::__construct | ( | EntityIdFormatter | $idFormatter, |
ValueFormatter | $valueFormatter, | ||
SnakFormatter | $snakFormatter, | ||
Language | $language, | ||
EntityIdParser | $idParser ) |
EntityIdFormatter | $idFormatter | Please note that the magic label substitution we apply on top of this only works in case this returns links without display text. |
ValueFormatter | $valueFormatter | |
SnakFormatter | $snakFormatter | |
Language | $language | |
EntityIdParser | $idParser |
InvalidArgumentException |
|
private |
Merge the total summary.
string | $autoComment | autocomment part, will be placed in a block comment |
string | $autoSummary | human readable string to be appended after the autocomment part |
string | $userSummary | user provided summary to be appended after the autoSummary |
|
protected |
Format an auto summary argument.
mixed | $arg |
|
protected |
array | $args |
Wikibase\Repo\SummaryFormatter::formatAutoComment | ( | FormatableSummary | $summary | ) |
Format the autocomment part of a full summary.
Note that the first argument is always the number of summary arguments supplied via addAutoSummaryArgs() (or the constructor), and the second one is always the language code supplied via setLanguage() (or the constructor).
FormatableSummary | $summary |
Wikibase\Repo\SummaryFormatter::formatAutoSummary | ( | FormatableSummary | $summary | ) |
Formats the auto summary part of a full summary.
FormatableSummary | $summary |
|
private |
|
protected |
Turns an associative array into a list of strings by rendering each key/value pair.
Keys will be left as-is, values will be rendered using formatArg().
array | $pairs |
Wikibase\Repo\SummaryFormatter::formatSummary | ( | FormatableSummary | $summary | ) |
Format the given summary.
FormatableSummary | $summary |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |