MediaWiki
master
ApiBlockInfoTrait.php
Go to the documentation of this file.
1
<?php
7
namespace
MediaWiki\Api
;
8
9
use
MediaWiki\Block\Block
;
10
use
MediaWiki\Language\Language
;
11
use
MediaWiki\User\UserIdentity
;
12
16
trait
ApiBlockInfoTrait
{
17
37
private
function
getBlockDetails(
38
Block
$block,
39
$language =
null
40
) {
41
return
(
new
ApiBlockInfoHelper
)->getBlockDetails(
42
$block, $language ?? $this->getLanguage(), $this->
getUser
() );
43
}
44
50
private
function
getBlockCode(
Block
$block ):
string
{
51
return
(
new
ApiBlockInfoHelper
)->getBlockCode( $block );
52
}
53
54
// region Methods required from ApiBase
63
abstract
public
function
getLanguage();
64
69
abstract
public
function
getUser
();
70
72
// endregion -- end of methods required from ApiBase
73
74
}
75
77
class_alias( ApiBlockInfoTrait::class,
'ApiBlockInfoTrait'
);
MediaWiki\Api\ApiBlockInfoHelper
Helper class for API modules that display block information.
Definition
ApiBlockInfoHelper.php:26
MediaWiki\Language\Language
Base class for language-specific code.
Definition
Language.php:68
MediaWiki\Api\ApiBlockInfoTrait
trait ApiBlockInfoTrait
Definition
ApiBlockInfoTrait.php:16
MediaWiki\Block\Block
Represents a block that may prevent users from performing specific operations.
Definition
Block.php:31
MediaWiki\User\UserIdentity
Interface for objects representing user identity.
Definition
UserIdentity.php:24
MediaWiki\Api
Definition
ApiAcquireTempUserName.php:8
MediaWiki\Api\getUser
getUser()
includes
Api
ApiBlockInfoTrait.php
Generated on Thu Jan 22 2026 10:23:11 for MediaWiki by
1.10.0