Hard deprecate User::blockedby(), User::getblockid()

Bug: T290869
Change-Id: If2d96705223bd80ffd68526773a2c81aaeaa898d
This commit is contained in:
vladshapik 2021-09-21 17:05:15 +03:00 committed by Vlad.shapik
parent 6c3b3844d5
commit 12b42e8023
3 changed files with 12 additions and 0 deletions

View file

@ -146,6 +146,10 @@ because of Phabricator reports.
should be used instead.
* SkinTemplate::getPersonalToolsList(), deprecated since 1.35, now emits
deprecation warnings.
* The following methods from the User class were hard deprecated:
- ::blockedBy
- ::getBlockId
* …
=== Other changes in 1.38 ===

View file

@ -1972,8 +1972,11 @@ class User implements Authority, UserIdentity, UserEmailContact {
/**
* If user is blocked, return the name of the user who placed the block
* @return string Name of blocker
* @deprecated since 1.38
* Hard deprecated since 1.38.
*/
public function blockedBy() {
wfDeprecated( __METHOD__, '1.38' );
$this->getBlockedStatus();
return $this->mBlockedby;
}
@ -1992,8 +1995,11 @@ class User implements Authority, UserIdentity, UserEmailContact {
/**
* If user is blocked, return the ID for the block
* @return int|false
* @deprecated since 1.38
* Hard deprecated since 1.38.
*/
public function getBlockId() {
wfDeprecated( __METHOD__, '1.38' );
$this->getBlockedStatus();
return ( $this->mBlock ? $this->mBlock->getId() : false );
}

View file

@ -1296,6 +1296,8 @@ class UserTest extends MediaWikiIntegrationTestCase {
* @covers User::isBlockedFrom
*/
public function testBlockInstanceCache() {
$this->hideDeprecated( 'User::blockedBy' );
$this->hideDeprecated( 'User::getBlockId' );
// First, check the user isn't blocked
$user = $this->getMutableTestUser()->getUser();
$ut = Title::makeTitle( NS_USER_TALK, $user->getName() );