MediaWiki  master
MediaWiki\Block\BlockErrorFormatter Class Reference

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

Public Member Functions

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

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 38 of file BlockErrorFormatter.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 50 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 69 of file BlockErrorFormatter.php.


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