Deprecate OutputPage::parserOptions() as a setter
authorBrad Jorsch <bjorsch@wikimedia.org>
Wed, 22 Nov 2017 20:12:43 +0000 (15:12 -0500)
committerBrad Jorsch <bjorsch@wikimedia.org>
Wed, 22 Nov 2017 20:17:00 +0000 (15:17 -0500)
The only known callers were using it to call ->setEditSections( false ),
which has been the default since MediaWiki 1.19.

Change-Id: Ib021d7e80e44782ba6ebe66cf8366bae9147ce00
Depends-On: I7de0102e6cac6b5aa0147b825fa2cb6ebd37b434
Depends-On: I7b0604773a8692c7cb37fffa3fcb8aaac83d81ba

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.
   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
 
 == 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
         * 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 ) {
         * @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.
                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.