MediaWiki 1.41.2
MediaWiki\Block\BlockErrorFormatter Class Reference

A service class for getting formatted information about a block. More...

Public Member Functions

 __construct (TitleFormatter $titleFormatter, HookContainer $hookContainer, UserIdentityUtils $userIdentityUtils)
 
 getMessage (Block $block, UserIdentity $user, Language $language, $ip)
 Get a block error message.
 

Detailed Description

A service class for getting formatted information about a block.

To obtain an instance, use MediaWikiServices::getInstance()->getBlockErrorFormatter().

Since
1.35

Definition at line 39 of file BlockErrorFormatter.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Block\BlockErrorFormatter::__construct ( TitleFormatter $titleFormatter,
HookContainer $hookContainer,
UserIdentityUtils $userIdentityUtils )
Parameters
TitleFormatter$titleFormatter
HookContainer$hookContainer
UserIdentityUtils$userIdentityUtils

Definition at line 57 of file BlockErrorFormatter.php.

Member Function Documentation

◆ getMessage()

MediaWiki\Block\BlockErrorFormatter::getMessage ( Block $block,
UserIdentity $user,
Language $language,
$ip )

Get a block error message.

Different message keys are chosen depending on the block features. Message parameters are formatted for the specified user and language.

Parameters
Block$block
UserIdentity$user
Language$language
string$ip
Returns
Message

Definition at line 78 of file BlockErrorFormatter.php.


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