Remove the TitleArrayFromResult hook

Hard deprecated in 1.36, unused
Note that this is separate from the TitleArrayFromResult class

Change-Id: I7cc2176c386529061fa6bd590ab9d60a86b064ba
This commit is contained in:
DannyS712 2021-06-02 13:46:17 +00:00
parent f361e4c5f9
commit 9435fd1303
5 changed files with 4 additions and 41 deletions

View file

@ -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.

View file

@ -1,27 +0,0 @@
<?php
namespace MediaWiki\Hook;
use TitleArray;
use Wikimedia\Rdbms\IResultWrapper;
/**
* This is a hook handler interface, see docs/Hooks.md.
* Use the hook name "TitleArrayFromResult" to register handlers implementing this interface.
*
* @deprecated since 1.36
* @ingroup Hooks
*/
interface TitleArrayFromResultHook {
/**
* This hook is called when creating a TitleArray object from a
* database result.
*
* @since 1.35
*
* @param TitleArray &$titleArray Set this to an object to override the default object returned
* @param IResultWrapper $res Database result used to create the object
* @return bool|void True or no return value to continue or false to abort
*/
public function onTitleArrayFromResult( &$titleArray, $res );
}

View file

@ -57,7 +57,6 @@ class DeprecatedHooks {
'SkinTemplatePreventOtherActiveTabs' => [ '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 ],

View file

@ -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',

View file

@ -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 );
}
}