aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUmherirrender <umherirrender_de.wp@web.de>2025-03-26 21:03:36 +0100
committerUmherirrender <umherirrender_de.wp@web.de>2025-03-26 21:03:36 +0100
commit663f485ac679736d946cdc2928df68172a2c5e9c (patch)
tree5442b6812484214a277672222c767543cc08d776
parentc792adc3b35bb045b2780d19944c118a05add5a2 (diff)
downloadmediawikicore-663f485ac679736d946cdc2928df68172a2c5e9c.tar.gz
mediawikicore-663f485ac679736d946cdc2928df68172a2c5e9c.zip
api: Remove deprecated ApiPageSet::get*Titles
The following functions were removed: - ApiPageSet::getTitles - ApiPageSet::getGoodTitles - ApiPageSet::getMissingTitles - ApiPageSet::getGoodAndMissingTitles - ApiPageSet::getRedirectTitles - ApiPageSet::getSpecialTitles Bug: T339384 Change-Id: Iba8499c2d1b4a10b918f563069534b90fed7f6f9
-rw-r--r--RELEASE-NOTES-1.444
-rw-r--r--includes/api/ApiPageSet.php67
-rw-r--r--tests/phpunit/includes/api/ApiPageSetTest.php27
3 files changed, 6 insertions, 92 deletions
diff --git a/RELEASE-NOTES-1.44 b/RELEASE-NOTES-1.44
index 79797ef6d03d..72a3311228b0 100644
--- a/RELEASE-NOTES-1.44
+++ b/RELEASE-NOTES-1.44
@@ -257,6 +257,10 @@ because of Phabricator reports.
* The `MediaWiki\User\Registration\IUserRegistrationProvider` interface now
defines a required fetchRegistrationBatch() method.
* The hook OutputPageMakeCategoryLinks, deprecated in 1.43, has been removed.
+* ApiPageSet::getTitles(), ApiPageSet::getGoodTitles(),
+ ApiPageSet::getMissingTitles(), ApiPageSet::getGoodAndMissingTitles(),
+ ApiPageSet::getRedirectTitles() and ApiPageSet::getSpecialTitles, deprecated
+ since 1.37, have been removed.
* The methods Skin::getFooterIcons and ::makeFooterIcon are final and
overriding is no longer supported.
* DatabaseBlock::getQueryInfo and ::getRangeCond, deprecated since 1.43, have
diff --git a/includes/api/ApiPageSet.php b/includes/api/ApiPageSet.php
index 47db90330f3d..5ec41d3a0283 100644
--- a/includes/api/ApiPageSet.php
+++ b/includes/api/ApiPageSet.php
@@ -457,19 +457,6 @@ class ApiPageSet extends ApiBase {
* Does not include special pages, interwiki links, and invalid titles.
* If redirects are resolved, both the redirect and the target will be included here.
*
- * @deprecated since 1.37, use getPages() instead, hard-deprecated since 1.43.
- * @return Title[]
- */
- public function getTitles() {
- wfDeprecated( __METHOD__, '1.37' );
- return $this->mTitles;
- }
-
- /**
- * All existing and missing pages including redirects.
- * Does not include special pages, interwiki links, and invalid titles.
- * If redirects are resolved, both the redirect and the target will be included here.
- *
* @since 1.37
* @return PageIdentity[]
*/
@@ -494,17 +481,6 @@ class ApiPageSet extends ApiBase {
}
/**
- * Title objects that were found in the database, including redirects.
- * If redirects are resolved, this will include existing redirect targets.
- * @deprecated since 1.37, use getGoodPages() instead, hard-deprecated since 1.43.
- * @return array<int,Title> Array page_id (int) => Title (obj)
- */
- public function getGoodTitles() {
- wfDeprecated( __METHOD__, '1.37' );
- return $this->mGoodTitles;
- }
-
- /**
* Pages that were found in the database, including redirects.
* If redirects are resolved, this will include existing redirect targets.
* @since 1.37
@@ -532,18 +508,6 @@ class ApiPageSet extends ApiBase {
}
/**
- * Title objects that were NOT found in the database.
- * The array's index will be negative for each item.
- * If redirects are resolved, this will include missing redirect targets.
- * @deprecated since 1.37, use getMissingPages instead, hard-deprecated since 1.43.
- * @return array<int,Title>
- */
- public function getMissingTitles() {
- wfDeprecated( __METHOD__, '1.37' );
- return $this->mMissingTitles;
- }
-
- /**
* Pages that were NOT found in the database.
* The array's index will be negative for each item.
* If redirects are resolved, this will include missing redirect targets.
@@ -563,16 +527,6 @@ class ApiPageSet extends ApiBase {
}
/**
- * Title objects for good and missing titles.
- * @deprecated since 1.37, use getGoodAndMissingPages() instead, hard-deprecated since 1.43.
- * @return Title[]
- */
- public function getGoodAndMissingTitles() {
- wfDeprecated( __METHOD__, '1.37' );
- return $this->mGoodTitles + $this->mMissingTitles;
- }
-
- /**
* Pages for good and missing titles.
* @since 1.37
* @return PageIdentity[]
@@ -601,17 +555,6 @@ class ApiPageSet extends ApiBase {
/**
* Get a list of redirect resolutions - maps a title to its redirect
* target.
- * @deprecated since 1.37, use getRedirectTargets instead, hard-deprecated since 1.43.
- * @return array<string,Title>
- */
- public function getRedirectTitles() {
- wfDeprecated( __METHOD__, '1.37' );
- return $this->mRedirectTitles;
- }
-
- /**
- * Get a list of redirect resolutions - maps a title to its redirect
- * target.
* @since 1.37
* @return LinkTarget[]
*/
@@ -872,16 +815,6 @@ class ApiPageSet extends ApiBase {
}
/**
- * Get the list of titles with negative namespace
- * @deprecated since 1.37, use getSpecialPages() instead, hard-deprecated since 1.43.
- * @return Title[]
- */
- public function getSpecialTitles() {
- wfDeprecated( __METHOD__, '1.37' );
- return $this->mSpecialTitles;
- }
-
- /**
* Get the list of pages with negative namespace
* @since 1.37
* @return PageReference[]
diff --git a/tests/phpunit/includes/api/ApiPageSetTest.php b/tests/phpunit/includes/api/ApiPageSetTest.php
index 2d4d15197a66..c8d46ae9f337 100644
--- a/tests/phpunit/includes/api/ApiPageSetTest.php
+++ b/tests/phpunit/includes/api/ApiPageSetTest.php
@@ -104,8 +104,6 @@ class ApiPageSetTest extends ApiTestCase {
}
public function testRedirectMergePolicyRedirectLoop() {
- $this->hideDeprecated( ApiPageSet::class . '::getTitles' );
-
$redirectOneTitle = 'ApiPageSetTestRedirectOne';
$redirectTwoTitle = 'ApiPageSetTestRedirectTwo';
$this->editPage( $redirectOneTitle, "#REDIRECT [[$redirectTwoTitle]]" );
@@ -128,8 +126,8 @@ class ApiPageSetTest extends ApiTestCase {
$redirectOneTitle, $redirectTwoTitle,
],
array_map( static function ( $x ) {
- return $x->getPrefixedText();
- }, $pageSet->getTitles() )
+ return $x->getDBkey();
+ }, $pageSet->getPages() )
);
}
@@ -334,13 +332,6 @@ class ApiPageSetTest extends ApiTestCase {
}
public function testPopulateFromTitles() {
- $this->hideDeprecated( ApiPageSet::class . '::getTitles' );
- $this->hideDeprecated( ApiPageSet::class . '::getGoodTitles' );
- $this->hideDeprecated( ApiPageSet::class . '::getMissingTitles' );
- $this->hideDeprecated( ApiPageSet::class . '::getGoodAndMissingTitles' );
- $this->hideDeprecated( ApiPageSet::class . '::getRedirectTitles' );
- $this->hideDeprecated( ApiPageSet::class . '::getSpecialTitles' );
-
$interwikiLookup = $this->getDummyInterwikiLookup( [ 'acme' ] );
$this->setService( 'InterwikiLookup', $interwikiLookup );
@@ -370,23 +361,16 @@ class ApiPageSetTest extends ApiTestCase {
// the redirect page and the target are included!
new TitleValue( NS_MAIN, 'ApiPageSetTest_redirect_target' ),
];
- $this->assertLinkTargets( Title::class, $expectedPages, $pageSet->getTitles() );
$this->assertLinkTargets( PageIdentity::class, $expectedPages, $pageSet->getPages() );
$expectedGood = [
new TitleValue( NS_MAIN, 'ApiPageSetTest_existing' ),
new TitleValue( NS_MAIN, 'ApiPageSetTest_redirect_target' )
];
- $this->assertLinkTargets( Title::class, $expectedGood, $pageSet->getGoodTitles() );
$this->assertLinkTargets( PageIdentity::class, $expectedGood, $pageSet->getGoodPages() );
$expectedMissing = [ new TitleValue( NS_MAIN, 'ApiPageSetTest_missing' ) ];
$this->assertLinkTargets(
- Title::class,
- $expectedMissing,
- $pageSet->getMissingTitles()
- );
- $this->assertLinkTargets(
PageIdentity::class,
$expectedMissing,
$pageSet->getMissingPages()
@@ -398,18 +382,12 @@ class ApiPageSetTest extends ApiTestCase {
$expectedGoodAndMissing = array_merge( $expectedGood, $expectedMissing );
$this->assertLinkTargets(
- Title::class,
- $expectedGoodAndMissing,
- $pageSet->getGoodAndMissingTitles()
- );
- $this->assertLinkTargets(
PageIdentity::class,
$expectedGoodAndMissing,
$pageSet->getGoodAndMissingPages()
);
$expectedSpecial = [ new TitleValue( NS_SPECIAL, 'BlankPage' ) ];
- $this->assertLinkTargets( Title::class, $expectedSpecial, $pageSet->getSpecialTitles() );
$this->assertLinkTargets( PageReference::class, $expectedSpecial, $pageSet->getSpecialPages() );
$expectedRedirects = [
@@ -417,7 +395,6 @@ class ApiPageSetTest extends ApiTestCase {
NS_MAIN, 'ApiPageSetTest_redirect_target'
)
];
- $this->assertLinkTargets( Title::class, $expectedRedirects, $pageSet->getRedirectTitles() );
$this->assertLinkTargets( LinkTarget::class, $expectedRedirects, $pageSet->getRedirectTargets() );
$this->assertSame( [ 'acme:ApiPageSetTest' => 'acme' ], $pageSet->getInterwikiTitles() );