mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-15 02:03:53 +00:00
cbea88f818
Unfortunately, this isn't using DI completely, because of the User::newSystemUser call. I'm not even sure if we really need to call it or we can just stick to new UserIdentityValue, but leaving like this for now. Also, the types were weakened to UserIdentity, so the transition is going to be easy anyway. Change-Id: I08f8fae0fcc622ff0ac3f86771476d06d1c18549
59 lines
1.6 KiB
PHP
59 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace MediaWiki\Extension\AbuseFilter;
|
|
|
|
use MediaWiki\MediaWikiServices;
|
|
|
|
class AbuseFilterServices {
|
|
/**
|
|
* Conveniency wrapper for strong typing
|
|
* @return KeywordsManager
|
|
*/
|
|
public static function getKeywordsManager() : KeywordsManager {
|
|
return MediaWikiServices::getInstance()->getService( KeywordsManager::SERVICE_NAME );
|
|
}
|
|
|
|
/**
|
|
* Conveniency wrapper for strong typing
|
|
* @return FilterProfiler
|
|
*/
|
|
public static function getFilterProfiler() : FilterProfiler {
|
|
return MediaWikiServices::getInstance()->getService( FilterProfiler::SERVICE_NAME );
|
|
}
|
|
|
|
/**
|
|
* @return AbuseFilterPermissionManager
|
|
*/
|
|
public static function getPermissionManager() : AbuseFilterPermissionManager {
|
|
return MediaWikiServices::getInstance()->getService( AbuseFilterPermissionManager::SERVICE_NAME );
|
|
}
|
|
|
|
/**
|
|
* @return ChangeTagger
|
|
*/
|
|
public static function getChangeTagger() : ChangeTagger {
|
|
return MediaWikiServices::getInstance()->getService( ChangeTagger::SERVICE_NAME );
|
|
}
|
|
|
|
/**
|
|
* @return ChangeTagsManager
|
|
*/
|
|
public static function getChangeTagsManager() : ChangeTagsManager {
|
|
return MediaWikiServices::getInstance()->getService( ChangeTagsManager::SERVICE_NAME );
|
|
}
|
|
|
|
/**
|
|
* @return BlockAutopromoteStore
|
|
*/
|
|
public static function getBlockAutopromoteStore() : BlockAutopromoteStore {
|
|
return MediaWikiServices::getInstance()->getService( BlockAutopromoteStore::SERVICE_NAME );
|
|
}
|
|
|
|
/**
|
|
* @return FilterUser
|
|
*/
|
|
public static function getFilterUser() : FilterUser {
|
|
return MediaWikiServices::getInstance()->getService( FilterUser::SERVICE_NAME );
|
|
}
|
|
}
|