From db2f1ad606a406c38d83ce8f7c8661fb0d0d95ab Mon Sep 17 00:00:00 2001 From: "C. Scott Ananian" Date: Fri, 12 Apr 2024 13:00:00 -0400 Subject: [PATCH] [ParserOutput] Remove deprecated ::getCategories() method This was deprecated with warnings in 1.40. Change-Id: I7b8a86f6efbdd86c1f493db6741c37bfb325e9bb --- RELEASE-NOTES-1.42 | 2 ++ includes/parser/ParserOutput.php | 10 ---------- tests/phpunit/includes/Output/OutputPageTest.php | 2 -- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/RELEASE-NOTES-1.42 b/RELEASE-NOTES-1.42 index a36688949ec..a67d4225cfd 100644 --- a/RELEASE-NOTES-1.42 +++ b/RELEASE-NOTES-1.42 @@ -240,6 +240,8 @@ because of Phabricator reports. - ipblocks * ParserOutput::setFlag() and ::getFlag(), deprecated in 1.38, were removed. You should use ::setOutputFlag() and ::getOutputFlag() instead. +* ParserOutput::getCategories(), deprecated in 1.40, has been removed. You + should use ::getCategoryNames() and ::getCategorySortKey() instead. * The parser does not substitute the default category sort key at parse time; this is substituted when the category links table is updated instead. As a result {{DEFAULTSORT}} will affect all the diff --git a/includes/parser/ParserOutput.php b/includes/parser/ParserOutput.php index 4b19bc03489..30206e518c4 100644 --- a/includes/parser/ParserOutput.php +++ b/includes/parser/ParserOutput.php @@ -619,16 +619,6 @@ class ParserOutput extends CacheTime implements ContentMetadataCollector { } /** - * @deprecated since 1.40; use ::getCategoryNames() and - * ::getCategorySortKey() instead. For @internal use ::getCategoryMap() - * may be used, but it is not recommended. - */ - public function &getCategories() { - wfDeprecated( __METHOD__, '1.40' ); - return $this->mCategories; - } - - /** * Return category names and sort keys as a map. * * BEWARE that numeric category names get converted to 'int' when stored diff --git a/tests/phpunit/includes/Output/OutputPageTest.php b/tests/phpunit/includes/Output/OutputPageTest.php index db8ce0810c0..53acb63f2c2 100644 --- a/tests/phpunit/includes/Output/OutputPageTest.php +++ b/tests/phpunit/includes/Output/OutputPageTest.php @@ -1281,7 +1281,6 @@ class OutputPageTest extends MediaWikiIntegrationTestCase { $op = $this->setupCategoryTests( $fakeResults, $variantLinkCallback ); $stubPO = $this->createParserOutputStub( [ - 'getCategories' => $args, 'getCategoryMap' => $args, ] ); @@ -1616,7 +1615,6 @@ class OutputPageTest extends MediaWikiIntegrationTestCase { } $arrayReturningMethods = [ - 'getCategories', 'getCategoryMap', 'getFileSearchOptions', 'getHeadItems', -- 2.11.4.GIT