MediaWiki master
ApiBlockInfoTrait.php
Go to the documentation of this file.
1<?php
6
7namespace MediaWiki\Api;
8
12
17
41 private function getBlockDetails(
42 Block $block,
43 $language = null,
44 bool $canSeeHiddenBlocks = false
45 ) {
46 return ( new ApiBlockInfoHelper )->getBlockDetails(
47 $block, $language ?? $this->getLanguage(), $this->getUser(), $canSeeHiddenBlocks );
48 }
49
55 private function getBlockCode( Block $block ): string {
56 return ( new ApiBlockInfoHelper )->getBlockCode( $block );
57 }
58
59 // region Methods required from ApiBase
63
68 abstract public function getLanguage();
69
74 abstract public function getUser();
75
77 // endregion -- end of methods required from ApiBase
78
79}
80
82class_alias( ApiBlockInfoTrait::class, 'ApiBlockInfoTrait' );
Helper class for API modules that display block information.
Base class for language-specific code.
Definition Language.php:65
Represents a block that may prevent users from performing specific operations.
Definition Block.php:32
Interface for objects representing user identity.