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, UserIdentityUtils $userIdentityUtils, LanguageFactory $languageFactory, LocalizationContext $uiContext)
 
 getMessage (Block $block, UserIdentity $user, $language, string $ip)
 Get a block error message.
 
 getMessages (Block $block, UserIdentity $user, string $ip)
 Get block error messages for all of the blocks that apply to a user.
 

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

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Block\BlockErrorFormatter::__construct ( TitleFormatter $titleFormatter,
HookContainer $hookContainer,
UserIdentityUtils $userIdentityUtils,
LanguageFactory $languageFactory,
LocalizationContext $uiContext )

Definition at line 49 of file BlockErrorFormatter.php.

Member Function Documentation

◆ getMessage()

MediaWiki\Block\BlockErrorFormatter::getMessage ( Block $block,
UserIdentity $user,
$language,
string $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.

If passed a CompositeBlock, will get a generic message stating that there are multiple blocks. To get all the block messages, use getMessages instead.

Parameters
Block$block
UserIdentity$user
mixed$languageUnused since 1.42
string$ip
Returns
Message

Definition at line 85 of file BlockErrorFormatter.php.

◆ getMessages()

MediaWiki\Block\BlockErrorFormatter::getMessages ( Block $block,
UserIdentity $user,
string $ip )

Get block error messages for all of the blocks that apply to a user.

Since
1.42
Parameters
Block$block
UserIdentity$user
string$ip
Returns
Message[]

Definition at line 105 of file BlockErrorFormatter.php.


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