From 9435fd13033b09c20a471ee04a8e09f99a848c92 Mon Sep 17 00:00:00 2001 From: DannyS712 Date: Wed, 2 Jun 2021 13:46:17 +0000 Subject: [PATCH] Remove the TitleArrayFromResult hook Hard deprecated in 1.36, unused Note that this is separate from the TitleArrayFromResult class Change-Id: I7cc2176c386529061fa6bd590ab9d60a86b064ba --- RELEASE-NOTES-1.37 | 1 + includes/Hook/TitleArrayFromResultHook.php | 27 ---------------------- includes/HookContainer/DeprecatedHooks.php | 1 - includes/HookContainer/HookRunner.php | 8 ------- includes/TitleArray.php | 8 +++---- 5 files changed, 4 insertions(+), 41 deletions(-) delete mode 100644 includes/Hook/TitleArrayFromResultHook.php diff --git a/RELEASE-NOTES-1.37 b/RELEASE-NOTES-1.37 index 51a9b616e0f..cbb1ba2cf1e 100644 --- a/RELEASE-NOTES-1.37 +++ b/RELEASE-NOTES-1.37 @@ -189,6 +189,7 @@ because of Phabricator reports. CachedAction, SpecialCachedPage, CacheHelper, ICacheHelper. * The hooks BeforeHttpsRedirect, CanIPUseHTTPS and UserRequiresHTTPS, deprecated in 1.35, were removed. +* The TitleArrayFromResult hook, deprecated in 1.36, was removed. * The deprecated "es6-promise" alias ResourceLoader module has been removed. Use "es6-polyfills" directly intead. * AuthenticationProvider interface doesn't extend LoggerAwareInterface. diff --git a/includes/Hook/TitleArrayFromResultHook.php b/includes/Hook/TitleArrayFromResultHook.php deleted file mode 100644 index b4e36dc63ee..00000000000 --- a/includes/Hook/TitleArrayFromResultHook.php +++ /dev/null @@ -1,27 +0,0 @@ - [ 'deprecatedVersion' => '1.35' ], 'SkinTemplateTabAction' => [ 'deprecatedVersion' => '1.35' ], 'SkinTemplateToolboxEnd' => [ 'deprecatedVersion' => '1.35' ], - 'TitleArrayFromResult' => [ 'deprecatedVersion' => '1.36' ], 'UserLoadFromDatabase' => [ 'deprecatedVersion' => '1.37' ], 'UserSetCookies' => [ 'deprecatedVersion' => '1.27' ], 'WikiPageDeletionUpdates' => [ 'deprecatedVersion' => '1.32', 'silent' => true ], diff --git a/includes/HookContainer/HookRunner.php b/includes/HookContainer/HookRunner.php index 4cc8b59f52b..1679a3fed80 100644 --- a/includes/HookContainer/HookRunner.php +++ b/includes/HookContainer/HookRunner.php @@ -367,7 +367,6 @@ class HookRunner implements \MediaWiki\Hook\SpecialWatchlistGetNonRevisionTypesHook, \MediaWiki\Hook\TestCanonicalRedirectHook, \MediaWiki\Hook\ThumbnailBeforeProduceHTMLHook, - \MediaWiki\Hook\TitleArrayFromResultHook, \MediaWiki\Hook\TitleExistsHook, \MediaWiki\Hook\TitleGetEditNoticesHook, \MediaWiki\Hook\TitleGetRestrictionTypesHook, @@ -3842,13 +3841,6 @@ class HookRunner implements ); } - public function onTitleArrayFromResult( &$titleArray, $res ) { - return $this->container->run( - 'TitleArrayFromResult', - [ &$titleArray, $res ] - ); - } - public function onTitleExists( $title, &$exists ) { return $this->container->run( 'TitleExists', diff --git a/includes/TitleArray.php b/includes/TitleArray.php index ff5a5bc5acb..b1de396732e 100644 --- a/includes/TitleArray.php +++ b/includes/TitleArray.php @@ -40,10 +40,8 @@ abstract class TitleArray implements Iterator { * @return TitleArrayFromResult */ public static function newFromResult( $res ) { - $array = null; - if ( !Hooks::runner()->onTitleArrayFromResult( $array, $res ) ) { - return null; - } - return $array ?? new TitleArrayFromResult( $res ); + // TODO consider merging this class with TitleArrayFromResult now that the + // TitleArrayFromResult hook has been removed + return new TitleArrayFromResult( $res ); } }