mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-12-12 00:27:47 +00:00
eef833a112
Changes to the use statements done automatically via script Change-Id: Ife9826099657bcaeca1beec94863a1600fdf55f8
44 lines
961 B
PHP
44 lines
961 B
PHP
<?php
|
|
/**
|
|
* DiscussionTools API hooks
|
|
*
|
|
* @file
|
|
* @ingroup Extensions
|
|
* @license MIT
|
|
*/
|
|
|
|
namespace MediaWiki\Extension\DiscussionTools\Hooks;
|
|
|
|
use MediaWiki\Api\ApiModuleManager;
|
|
use MediaWiki\Api\Hook\ApiMain__moduleManagerHook;
|
|
use MediaWiki\Extension\DiscussionTools\ApiDiscussionToolsThank;
|
|
use MediaWiki\Registration\ExtensionRegistry;
|
|
|
|
// phpcs:disable MediaWiki.NamingConventions.LowerCamelFunctionsName.FunctionName
|
|
|
|
class ApiHooks implements
|
|
ApiMain__moduleManagerHook
|
|
{
|
|
/**
|
|
* @param ApiModuleManager $moduleManager
|
|
* @return bool|void
|
|
*/
|
|
public function onApiMain__moduleManager( $moduleManager ) {
|
|
if ( ExtensionRegistry::getInstance()->isLoaded( 'Thanks' ) ) {
|
|
$moduleManager->addModule(
|
|
'discussiontoolsthank',
|
|
'action',
|
|
[
|
|
'class' => ApiDiscussionToolsThank::class,
|
|
'services' => [
|
|
'PermissionManager',
|
|
'ThanksLogStore',
|
|
'RevisionLookup',
|
|
'UserFactory',
|
|
]
|
|
]
|
|
);
|
|
}
|
|
}
|
|
}
|