diff --git a/RELEASE-NOTES-1.38 b/RELEASE-NOTES-1.38 index 1865a999919..dbf40fcb749 100644 --- a/RELEASE-NOTES-1.38 +++ b/RELEASE-NOTES-1.38 @@ -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 === diff --git a/includes/user/User.php b/includes/user/User.php index 4ea34e9a587..348646ea7ec 100644 --- a/includes/user/User.php +++ b/includes/user/User.php @@ -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 ); } diff --git a/tests/phpunit/includes/user/UserTest.php b/tests/phpunit/includes/user/UserTest.php index 41806ced1c1..ac1e3f12f7f 100644 --- a/tests/phpunit/includes/user/UserTest.php +++ b/tests/phpunit/includes/user/UserTest.php @@ -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() );