Anomie has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393262 )

Change subject: Warn if stateful ParserOutput transforms are used
......................................................................

Warn if stateful ParserOutput transforms are used

This should help clean up any missed uses.

Change-Id: I371f3b27d245d6927c74ea52f1df9fd5c675b94a
Depends-On: I30f162aa43c7f513df1153e0884a4339e4279aeb
Depends-On: Iff28b00638c15de7307a130196bbb91cda91c3d1
Depends-On: I432da8c0686c279b3c2e770f7f9e20248589d6db
Depends-On: I404f064b93573e80b61a228e3cf2b5d2add65c39
Depends-On: Ia54a9e3d11c9ab28975947148d0841819f3a8e3c
Depends-On: I2cd7519186f2319f32cf6288655ddb873337a638
Depends-On: I28b46cf4da66cc6e1f04045939a243faa30bc9bf
Depends-On: I3565868af824a08235ab5ce4a34145895ed0e74d
Depends-On: I0d05ce2f565778a4bf39d3d25d26acd0b8043788
Depends-On: I100fae755ae7e729d11163377fbddaebeaa020a6
Depends-On: I38e56d04f7ffbe8796dbda6500106a028a459980
Depends-On: Id6ad08a0b1f8575e7ee98916217a84c09e72dd3b
Depends-On: I2794430f6bc076f073e79e662701403f7e063c35
Depends-On: I39b599246759baad2164a29244150c99f0920684
Depends-On: Ic7aa606b7d697e06c74c1e9207efc77442f5b0c3
Depends-On: I140ff32373430b61b92226689ef9b58cca317450
Depends-On: I9b082e37f19c8baa182b0583c7d70d692fafc16e
---
M includes/parser/ParserOutput.php
M tests/phpunit/includes/parser/ParserOutputTest.php
2 files changed, 9 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/62/393262/1

diff --git a/includes/parser/ParserOutput.php b/includes/parser/ParserOutput.php
index fb4a169..714e261 100644
--- a/includes/parser/ParserOutput.php
+++ b/includes/parser/ParserOutput.php
@@ -271,13 +271,16 @@
         * @return string HTML
         */
        public function getText( $options = [] ) {
-               // @todo Warn if !array_key_exists( 'allowTOC', $options ) && 
empty( $this->mTOCEnabled )
+               if ( !array_key_exists( 'allowTOC', $options ) && empty( 
$this->mTOCEnabled ) ) {
+                       wfDeprecated( 'ParserOutput stateful allowTOC', '1.31' 
);
+               }
 
-               // @todo Warn if !array_key_exists( 'enableSectionEditLinks', 
$options )
-               //     && !$this->mEditSectionTokens
                //  Note that while $this->mEditSectionTokens formerly 
defaulted to false,
                //  ParserOptions->getEditSection() defaults to true and Parser 
copies
                //  that to us so true makes more sense as the stateless 
default.
+               if ( !array_key_exists( 'enableSectionEditLinks', $options ) && 
!$this->mEditSectionTokens ) {
+                       wfDeprecated( 'ParserOutput stateful 
enableSectionEditLinks', '1.31' );
+               }
 
                $options += [
                        'allowTOC' => !empty( $this->mTOCEnabled ),
diff --git a/tests/phpunit/includes/parser/ParserOutputTest.php 
b/tests/phpunit/includes/parser/ParserOutputTest.php
index ef35363b..a31d972 100644
--- a/tests/phpunit/includes/parser/ParserOutputTest.php
+++ b/tests/phpunit/includes/parser/ParserOutputTest.php
@@ -100,6 +100,9 @@
         * @param string $expect Expected output
         */
        public function testGetText( $options, $poState, $text, $expect ) {
+               $this->hideDeprecated( 'ParserOutput stateful allowTOC' );
+               $this->hideDeprecated( 'ParserOutput stateful 
enableSectionEditLinks' );
+
                $po = new ParserOutput( $text );
 
                // Emulate Parser

-- 
To view, visit https://gerrit.wikimedia.org/r/393262
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I371f3b27d245d6927c74ea52f1df9fd5c675b94a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Anomie <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to