Merge "maintenance: Script to rename titles for Unicode uppercasing changes"
[lhc/web/wiklou.git] / includes / api / ApiQueryUserInfo.php
index c495c6d..ba7280d 100644 (file)
@@ -20,6 +20,7 @@
  * @file
  */
 
+use MediaWiki\Block\AbstractBlock;
 use MediaWiki\MediaWikiServices;
 
 /**
@@ -52,6 +53,26 @@ class ApiQueryUserInfo extends ApiQueryBase {
                $result->addValue( 'query', $this->getModuleName(), $r );
        }
 
+       /**
+        * Get basic info about a given block
+        *
+        * @deprecated since 1.34 Use ApiBlockInfoTrait::getBlockDetails() instead.
+        * @param AbstractBlock $block
+        * @return array See ApiBlockInfoTrait::getBlockDetails
+        */
+       public static function getBlockInfo( AbstractBlock $block ) {
+               wfDeprecated( __METHOD__, '1.34' );
+
+               // Hack to access a private method from a trait:
+               $dummy = new class {
+                       use ApiBlockInfoTrait {
+                               getBlockDetails as public;
+                       }
+               };
+
+               return $dummy->getBlockDetails( $block );
+       }
+
        /**
         * Get central user info
         * @param Config $config
@@ -104,7 +125,7 @@ class ApiQueryUserInfo extends ApiQueryBase {
                if ( isset( $this->prop['blockinfo'] ) ) {
                        $block = $user->getBlock();
                        if ( $block ) {
-                               $vals = array_merge( $vals, $this->getBlockInfo( $block ) );
+                               $vals = array_merge( $vals, $this->getBlockDetails( $block ) );
                        }
                }