Deprecate string type for $lang of DifferenceEngine::setTextLanguage
authorFomafix <fomafix@googlemail.com>
Tue, 19 Jun 2018 19:37:17 +0000 (21:37 +0200)
committerKrinkle <krinklemail@gmail.com>
Mon, 2 Jul 2018 21:25:36 +0000 (21:25 +0000)
Also move the comment about the default value from the setter to the
getter.

Change-Id: I2e1bd29db986dfa92d41a876340a6aa59ac6670d
Depends-On: I8b573866c2de9b21d3849f02269c1b9ca4f62aba

RELEASE-NOTES-1.32
includes/diff/DifferenceEngine.php

index d0d5eb2..a269629 100644 (file)
@@ -227,6 +227,7 @@ because of Phabricator reports.
 * The 'jquery.hidpi' module (polyfill for IMG srcset) is deprecated.
 * ResourceLoaderStartUpModule::getStartupModules() and ::getLegacyModules()
   are deprecated. These concepts are obsolete and have no replacement.
+* String type for $lang of DifferenceEngine::setTextLanguage is deprecated.
 
 === Other changes in 1.32 ===
 * …
index ff07fe7..a77dab8 100644 (file)
@@ -132,6 +132,8 @@ class DifferenceEngine extends ContextSource {
        }
 
        /**
+        * Get the language of the difference engine, defaults to page content language
+        *
         * @return Language
         */
        public function getDiffLang() {
@@ -1343,11 +1345,14 @@ class DifferenceEngine extends ContextSource {
 
        /**
         * Set the language in which the diff text is written
-        * (Defaults to page content language).
-        * @param Language|string $lang
+        *
+        * @param Language $lang
         * @since 1.19
         */
        public function setTextLanguage( $lang ) {
+               if ( !$lang instanceof Language ) {
+                       wfDeprecated( __METHOD__ . ' with other type than Language for $lang', '1.32' );
+               }
                $this->mDiffLang = wfGetLangObj( $lang );
        }