mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-24 00:13:36 +00:00
BetaPreferenceHooks: Reuse $this->config
Change-Id: I782da96af4786ce812665a1e08bd89cacc52747e
This commit is contained in:
parent
11ef3a577d
commit
c675410755
|
@ -6,7 +6,6 @@ use MediaWiki\Config\Config;
|
|||
use MediaWiki\Config\ConfigFactory;
|
||||
use MediaWiki\Extension\BetaFeatures\Hooks\GetBetaFeaturePreferencesHook;
|
||||
use MediaWiki\MainConfigNames;
|
||||
use MediaWiki\MediaWikiServices;
|
||||
use MediaWiki\User\User;
|
||||
|
||||
/**
|
||||
|
@ -33,11 +32,9 @@ class BetaPreferenceHooks implements GetBetaFeaturePreferencesHook {
|
|||
if ( $this->config->get( 'DiscussionToolsBeta' ) ) {
|
||||
// If all configurable features are marked as 'available', the
|
||||
// beta fetaure enables nothing, so don't show it.
|
||||
$services = MediaWikiServices::getInstance();
|
||||
$dtConfig = $services->getConfigFactory()->makeConfig( 'discussiontools' );
|
||||
$allAvailable = true;
|
||||
foreach ( HookUtils::CONFIGS as $feature ) {
|
||||
if ( $dtConfig->get( 'DiscussionTools_' . $feature ) !== 'available' ) {
|
||||
if ( $this->config->get( 'DiscussionTools_' . $feature ) !== 'available' ) {
|
||||
$allAvailable = false;
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue