BetaPreferenceHooks: Reuse $this->config

Change-Id: I782da96af4786ce812665a1e08bd89cacc52747e
This commit is contained in:
Fomafix 2024-07-03 15:13:37 +00:00
parent 11ef3a577d
commit c675410755

View file

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