Remove several methods, deprecated in 1.32
authorDerick Alangi <alangiderick@gmail.com>
Thu, 9 May 2019 16:03:57 +0000 (17:03 +0100)
committerJames D. Forrester <jforrester@wikimedia.org>
Thu, 9 May 2019 18:36:44 +0000 (11:36 -0700)
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

RELEASE-NOTES-1.34
includes/OutputPage.php
includes/actions/WatchAction.php
includes/api/ApiBase.php
includes/collation/IcuCollation.php
includes/htmlform/HTMLForm.php
includes/resourceloader/ResourceLoaderStartUpModule.php
includes/skins/BaseTemplate.php
includes/skins/QuickTemplate.php
tests/phpunit/includes/actions/WatchActionTest.php

index e5e95d2..e2d22b7 100644 (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 ===
index e0f25cd..641f0b8 100644 (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
         *
index aaccc0c..0eba613 100644 (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;
        }
index bc62906..8d0d314 100644 (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;
-       }
-
        /**@}*/
 }
 
index 9c1c5f8..7774a60 100644 (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.
index 99671c0..85a2a1b 100644 (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
index 8cbde09..c834db1 100644 (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
index 8fe35f0..6d108e8 100644 (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.
         */
index 5044301..6bcf1c3 100644 (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.
index 044c30a..cdd7576 100644 (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()
         */