Merge "Deprecate OutputPage::parserOptions() as a setter"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 22 Nov 2017 20:45:47 +0000 (20:45 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 22 Nov 2017 20:45:47 +0000 (20:45 +0000)
RELEASE-NOTES-1.31
includes/OutputPage.php

index 5f91df6..3de0e17 100644 (file)
@@ -104,6 +104,7 @@ changes to languages because of Phabricator reports.
   DifferenceEngine::MW_DIFF_VERSION should be used instead.
 * Use of Maintenance::error( $err, $die ) to exit script was deprecated. Use
   Maintenance::fatalError() instead.
+* Passing a ParserOptions object to OutputPage::parserOptions() is deprecated.
 
 == Compatibility ==
 MediaWiki 1.31 requires PHP 5.5.9 or later. There is experimental support for
index 4635f99..a5f9c18 100644 (file)
@@ -1573,10 +1573,14 @@ class OutputPage extends ContextSource {
         * Get/set the ParserOptions object to use for wikitext parsing
         *
         * @param ParserOptions|null $options Either the ParserOption to use or null to only get the
-        *   current ParserOption object
+        *   current ParserOption object. This parameter is deprecated since 1.31.
         * @return ParserOptions
         */
        public function parserOptions( $options = null ) {
+               if ( $options !== null ) {
+                       wfDeprecated( __METHOD__ . ' with non-null $options', '1.31' );
+               }
+
                if ( $options !== null && !empty( $options->isBogus ) ) {
                        // Someone is trying to set a bogus pre-$wgUser PO. Check if it has
                        // been changed somehow, and keep it if so.