Remove several methods, deprecated in 1.32

I've checked and doubled checked that these methods are no longer used
anywhere in core or extensions, hence removed them. They were hard deprecated
in MediaWiki 1.32.

* OutputPage:
  ** `::showFileCopyError()`
  ** `::showFileRenameError()`
  ** `::showFileDeleteError()`
  ** `::showFileNotFoundError()`

* ApiBase:
  ** `::truncateArray()`

* IcuCollation:
  ** `::getICUVersion()`

* HTMLForm:
  ** `::setSubmitProgressive()`

* ResourceLoaderStartUpModules:
  ** `::getStartupModules()`
  ** `::getLegacyModules()`

* BaseTemplate:
  ** `::msgHtml()`

* QuickTemplate:
  ** `::msgHtml()`

* WatchAction:
  ** `::getUnwatchToken()`

Bug: T220656
Change-Id: Ic1a723a991f4ff63fcb5f045ddcda18d1f8c3c68
This commit is contained in:
Derick Alangi 2019-05-09 17:03:57 +01:00 committed by James D. Forrester
parent 37f35b5e56
commit 1981823755
10 changed files with 14 additions and 164 deletions

View file

@ -123,6 +123,20 @@ because of Phabricator reports.
* Output::sectionEditLinksEnabled(), ParserOutput::getEditSectionTokens,
::getTOCEnabled, ::setEditSectionTokens, ::setTOCEnabled, deprecated in 1.31
have been removed.
* Four methods in OutputPage, deprecated in 1.32, have been removed. You should
use OutputPage::showFatalError or throw a FatalError instead. The methods are
::showFileCopyError(), ::showFileRenameError(), ::showFileDeleteError(), and
::showFileNotFoundError().
* ApiBase::truncateArray(), deprecated in 1.32, has been removed.
* IcuCollation::getICUVersion(), deprecated in 1.32, has been removed. Use PHP's
INTL_ICU_VERSION constant directly.
* HTMLForm::setSubmitProgressive(), deprecated in 1.32, has been removed.
* ResourceLoaderStartUpModules::getStartupModules() and ::getLegacyModules(),
both deprecated in 1.32, have been removed.
* BaseTemplate::msgHtml() and QuickTemplate::msgHtml(), deprecated in 1.32, have
been removed. Use ->msg() or ->getMsg() instead.
* WatchAction::getUnwatchToken(), deprecated in 1.32, has been removed. Instead,
use WatchAction::getWatchToken() with action 'unwatch' directly.
* …
=== Deprecations in 1.34 ===

View file

@ -2998,46 +2998,6 @@ class OutputPage extends ContextSource {
$this->addHTML( $message );
}
/**
* @deprecated 1.32 Use OutputPage::showFatalError or throw FatalError instead.
*/
public function showUnexpectedValueError( $name, $val ) {
wfDeprecated( __METHOD__, '1.32' );
$this->showFatalError( $this->msg( 'unexpected', $name, $val )->escaped() );
}
/**
* @deprecated 1.32 Use OutputPage::showFatalError or throw FatalError instead.
*/
public function showFileCopyError( $old, $new ) {
wfDeprecated( __METHOD__, '1.32' );
$this->showFatalError( $this->msg( 'filecopyerror', $old, $new )->escaped() );
}
/**
* @deprecated 1.32 Use OutputPage::showFatalError or throw FatalError instead.
*/
public function showFileRenameError( $old, $new ) {
wfDeprecated( __METHOD__, '1.32' );
$this->showFatalError( $this->msg( 'filerenameerror', $old, $new )->escaped() );
}
/**
* @deprecated 1.32 Use OutputPage::showFatalError or throw FatalError instead.
*/
public function showFileDeleteError( $name ) {
wfDeprecated( __METHOD__, '1.32' );
$this->showFatalError( $this->msg( 'filedeleteerror', $name )->escaped() );
}
/**
* @deprecated 1.32 Use OutputPage::showFatalError or throw FatalError instead.
*/
public function showFileNotFoundError( $name ) {
wfDeprecated( __METHOD__, '1.32' );
$this->showFatalError( $this->msg( 'filenotfound', $name )->escaped() );
}
/**
* Add a "return to" link pointing to a specified title
*

View file

@ -173,21 +173,6 @@ class WatchAction extends FormAction {
return $user->getEditToken( $action );
}
/**
* Get token to unwatch (or watch) a page for a user
*
* @param Title $title Title object of page to unwatch
* @param User $user User for whom the action is going to be performed
* @param string $action Optionally override the action to 'watch'
* @return string Token
* @since 1.18
* @deprecated since 1.32 Use WatchAction::getWatchToken() with action 'unwatch' directly.
*/
public static function getUnwatchToken( Title $title, User $user, $action = 'unwatch' ) {
wfDeprecated( __METHOD__, '1.32' );
return self::getWatchToken( $title, $user, $action );
}
public function doesWrites() {
return true;
}

View file

@ -2685,24 +2685,6 @@ abstract class ApiBase extends ContextSource {
] ];
}
/**
* Truncate an array to a certain length.
* @deprecated since 1.32, no replacement
* @param array &$arr Array to truncate
* @param int $limit Maximum length
* @return bool True if the array was truncated, false otherwise
*/
public static function truncateArray( &$arr, $limit ) {
wfDeprecated( __METHOD__, '1.32' );
$modified = false;
while ( count( $arr ) > $limit ) {
array_pop( $arr );
$modified = true;
}
return $modified;
}
/**@}*/
}

View file

@ -526,23 +526,6 @@ class IcuCollation extends Collation {
return false;
}
/**
* Return the version of ICU library used by PHP's intl extension,
* or false when the extension is not installed of the version
* can't be determined.
*
* The constant INTL_ICU_VERSION this function refers to isn't really
* documented, but see https://bugs.php.net/bug.php?id=54561.
*
* @since 1.21
* @deprecated since 1.32, use INTL_ICU_VERSION directly
* @return string
*/
static function getICUVersion() {
wfDeprecated( __METHOD__, '1.32' );
return INTL_ICU_VERSION;
}
/**
* Return the version of Unicode appropriate for the version of ICU library
* currently in use, or false when it can't be determined.

View file

@ -1373,21 +1373,6 @@ class HTMLForm extends ContextSource {
return $this;
}
/**
* Identify that the submit button in the form has a progressive action
* @since 1.25
* @deprecated since 1.32, No need to call. Submit button already
* has a progressive action form.
*
* @return HTMLForm $this for chaining calls (since 1.28)
*/
public function setSubmitProgressive() {
wfDeprecated( __METHOD__, '1.32' );
$this->mSubmitFlags = [ 'progressive', 'primary' ];
return $this;
}
/**
* Set the text for the submit button to a message
* @since 1.19

View file

@ -321,29 +321,6 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule {
return true;
}
/**
* Internal modules used by ResourceLoader that cannot be depended on.
*
* These module(s) should have isRaw() return true, and are not
* legal dependencies (enforced by structure/ResourcesTest).
*
* @deprecated since 1.32 No longer used.
* @return array
*/
public static function getStartupModules() {
wfDeprecated( __METHOD__, '1.32' );
return [];
}
/**
* @deprecated since 1.32 No longer used.
* @return array
*/
public static function getLegacyModules() {
wfDeprecated( __METHOD__, '1.32' );
return [];
}
/**
* @private For internal use by SpecialJavaScriptTest
* @since 1.32

View file

@ -43,18 +43,6 @@ abstract class BaseTemplate extends QuickTemplate {
echo $this->getMsg( $str )->escaped();
}
/**
* @param string $str
* @warning You should never use this method. I18n messages should be escaped
* @deprecated 1.32 Use ->msg() or ->getMsg() instead.
* @suppress SecurityCheck-XSS
* @return-taint exec_html
*/
function msgHtml( $str ) {
wfDeprecated( __METHOD__, '1.32' );
echo $this->getMsg( $str )->text();
}
/**
* @deprecated since 1.33 Use ->msg() or ->getMsg() instead.
*/

View file

@ -125,19 +125,6 @@ abstract class QuickTemplate {
echo htmlspecialchars( wfMessage( $msgKey )->text() );
}
/**
* @private
* @param string $msgKey
* @warning You should never use this method. I18n messages should be escaped
* @deprecated 1.32 Use ->msg() instead.
* @suppress SecurityCheck-XSS
* @return-taint exec_html
*/
function msgHtml( $msgKey ) {
wfDeprecated( __METHOD__, '1.32' );
echo wfMessage( $msgKey )->text();
}
/**
* An ugly, ugly hack.
* @deprecated since 1.33 Use ->msg() instead.

View file

@ -270,17 +270,6 @@ class WatchActionTest extends MediaWikiTestCase {
WatchAction::getWatchToken( $this->watchAction->getTitle(), $user );
}
/**
* @covers WatchAction::getUnwatchToken()
*/
public function testGetUnwatchToken() {
$user = $this->getMock( User::class );
$user->expects( $this->once() )->method( 'getEditToken' );
$this->hideDeprecated( 'WatchAction::getUnwatchToken' );
WatchAction::getUnWatchToken( $this->watchAction->getTitle(), $user );
}
/**
* @covers WatchAction::doWatchOrUnwatch()
*/