Formatter for machine-readable autocomments as generated by SummaryFormatter in the repo.
More...
Formatter for machine-readable autocomments as generated by SummaryFormatter in the repo.
- Copyright
- GPL-2.0-or-later
◆ __construct()
Wikibase\Lib\Formatters\AutoCommentFormatter::__construct |
( |
Language |
$language, |
|
|
array |
$messagePrefixes |
|
) |
| |
- Parameters
-
Language | $language | |
string[] | $messagePrefixes | Prefixes to try when constructing the message key from the name given in the autocomment block. Typically something like [ 'wikibase-item', 'wikibase-entity' ]. |
◆ formatAutoComment()
Wikibase\Lib\Formatters\AutoCommentFormatter::formatAutoComment |
( |
|
$auto | ) |
|
Pretty formatting of autocomments.
- Warning
- This method is used to parse and format autocomment strings from the revision history. It should remain compatible with any old autocomment strings that may be in the database.
- See also
- https://www.mediawiki.org/wiki/Manual:Hooks/FormatAutocomments
-
docs/summaries.txt
- Parameters
-
string | $auto | the autocomment unformatted |
- Returns
- string|null The localized summary (HTML), or null
◆ getSummaryMessage()
Wikibase\Lib\Formatters\AutoCommentFormatter::getSummaryMessage |
( |
|
$name | ) |
|
|
private |
Gets the summary message.
- Parameters
-
- Returns
- Message|false
◆ wrapAutoComment()
Wikibase\Lib\Formatters\AutoCommentFormatter::wrapAutoComment |
( |
|
$pre, |
|
|
|
$comment, |
|
|
|
$post |
|
) |
| |
Wraps a comment by applying the appropriate directionality markers and pre and/or postfix separators.
- Note
- This code should be kept in sync with what Linker::formatAutocomments does.
- Parameters
-
boolean | $pre | True if there is text before the comment, so a prefix separator is needed. |
string | $comment | the localized comment, as returned by formatAutoComment() |
boolean | $post | True if there is text after the comment, so a postfix separator is needed. |
- Returns
- string
◆ $language
Wikibase\Lib\Formatters\AutoCommentFormatter::$language |
|
private |
◆ $messagePrefixes
Wikibase\Lib\Formatters\AutoCommentFormatter::$messagePrefixes |
|
private |
◆ $messages
Wikibase\Lib\Formatters\AutoCommentFormatter::$messages = [] |
|
private |
The documentation for this class was generated from the following file: