Formatter for Summary objects.
More...
Formatter for Summary objects.
- Copyright
- GPL-2.0-or-later
◆ __construct()
Wikibase\Repo\SummaryFormatter::__construct |
( |
EntityIdFormatter |
$idFormatter, |
|
|
ValueFormatter |
$valueFormatter, |
|
|
SnakFormatter |
$snakFormatter, |
|
|
Language |
$language, |
|
|
EntityIdParser |
$idParser |
|
) |
| |
- Parameters
-
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 | |
- Exceptions
-
◆ assembleSummaryString()
Wikibase\Repo\SummaryFormatter::assembleSummaryString |
( |
|
$autoComment, |
|
|
|
$autoSummary, |
|
|
|
$userSummary |
|
) |
| |
|
private |
Merge the total summary.
- Parameters
-
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 |
- Returns
- string to be used for the summary
◆ formatArg()
Wikibase\Repo\SummaryFormatter::formatArg |
( |
|
$arg | ) |
|
|
protected |
Format an auto summary argument.
- Parameters
-
- Returns
- string
◆ formatArgList()
Wikibase\Repo\SummaryFormatter::formatArgList |
( |
array |
$args | ) |
|
|
protected |
- Parameters
-
- Returns
- string[]
◆ formatAutoComment()
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).
- Parameters
-
FormatableSummary | $summary | |
- Returns
- string with a formatted comment, or possibly an empty string
◆ formatAutoSummary()
Formats the auto summary part of a full summary.
- Parameters
-
FormatableSummary | $summary | |
- Exceptions
-
- Returns
- string The auto summary arguments comma-separated
◆ formatIfEntityId()
Wikibase\Repo\SummaryFormatter::formatIfEntityId |
( |
|
$value | ) |
|
|
private |
◆ formatKeyValuePairs()
Wikibase\Repo\SummaryFormatter::formatKeyValuePairs |
( |
array |
$pairs | ) |
|
|
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().
- Parameters
-
- Returns
- string[]
◆ formatSummary()
Format the given summary.
- Parameters
-
FormatableSummary | $summary | |
- Returns
- string to be used for the summary
◆ $idFormatter
Wikibase\Repo\SummaryFormatter::$idFormatter |
|
private |
◆ $idParser
Wikibase\Repo\SummaryFormatter::$idParser |
|
private |
◆ $language
Wikibase\Repo\SummaryFormatter::$language |
|
private |
◆ $snakFormatter
Wikibase\Repo\SummaryFormatter::$snakFormatter |
|
private |
◆ $stringNormalizer
Wikibase\Repo\SummaryFormatter::$stringNormalizer |
|
private |
◆ $valueFormatter
Wikibase\Repo\SummaryFormatter::$valueFormatter |
|
private |
The documentation for this class was generated from the following file: