Hard deprecate OutputPage::parse() and OutputPage::parseInline()
authorC. Scott Ananian <cscott@cscott.net>
Fri, 26 Oct 2018 15:28:12 +0000 (11:28 -0400)
committerC. Scott Ananian <cananian@wikimedia.org>
Thu, 1 Nov 2018 21:32:56 +0000 (21:32 +0000)
Depends-On: I2cc3a4631bcb45b7f8cd913e9b6dba14349e5e9e
Depends-On: Ieaac7a198cacec406a8240ed07b2d9f32ef9e56a
Depends-On: Ia4b63715380d97ccb3133bf39a260834c20b4f5a
Depends-On: I88fb74c3007360e2301c8bca7db6a940e966a735
Change-Id: If5c619cdd3e7f786687cfc2ca166074d9197ca11

includes/OutputPage.php
tests/phpunit/includes/OutputPageTest.php

index aa2afe9..ff044f4 100644 (file)
@@ -2098,6 +2098,7 @@ class OutputPage extends ContextSource {
         *  parseAsInterface() if $interface is true.
         */
        public function parse( $text, $linestart = true, $interface = false, $language = null ) {
+               wfDeprecated( __METHOD__, '1.33' );
                return $this->parseInternal(
                        $text, $this->getTitle(), $linestart, /*tidy*/false, $interface, $language
                )->getText( [
@@ -2180,6 +2181,7 @@ class OutputPage extends ContextSource {
         *   Parser::stripOuterParagraph($outputPage->parseAsContent(...)).
         */
        public function parseInline( $text, $linestart = true, $interface = false ) {
+               wfDeprecated( __METHOD__, '1.33' );
                $parsed = $this->parseInternal(
                        $text, $this->getTitle(), $linestart, /*tidy*/false, $interface, /*language*/null
                )->getText( [
index e572be2..00a08a7 100644 (file)
@@ -1806,6 +1806,7 @@ class OutputPageTest extends MediaWikiTestCase {
         * @param string $expectedHTML Expected return value for parseInline(), if different
         */
        public function testParse( array $args, $expectedHTML ) {
+               $this->hideDeprecated( 'OutputPage::parse' );
                $op = $this->newInstance();
                $this->assertSame( $expectedHTML, $op->parse( ...$args ) );
        }
@@ -1820,6 +1821,7 @@ class OutputPageTest extends MediaWikiTestCase {
                        $this->assertTrue( true );
                        return;
                }
+               $this->hideDeprecated( 'OutputPage::parseInline' );
                $op = $this->newInstance();
                $this->assertSame( $expectedHTMLInline ?? $expectedHTML, $op->parseInline( ...$args ) );
        }
@@ -1953,6 +1955,7 @@ class OutputPageTest extends MediaWikiTestCase {
         * @covers OutputPage::parse
         */
        public function testParseNullTitle() {
+               $this->hideDeprecated( 'OutputPage::parse' );
                $this->setExpectedException( MWException::class, 'Empty $mTitle in OutputPage::parseInternal' );
                $op = $this->newInstance( [], null, 'notitle' );
                $op->parse( '' );
@@ -1962,6 +1965,7 @@ class OutputPageTest extends MediaWikiTestCase {
         * @covers OutputPage::parseInline
         */
        public function testParseInlineNullTitle() {
+               $this->hideDeprecated( 'OutputPage::parseInline' );
                $this->setExpectedException( MWException::class, 'Empty $mTitle in OutputPage::parseInternal' );
                $op = $this->newInstance( [], null, 'notitle' );
                $op->parseInline( '' );