Santhosh has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/219804

Change subject: Fix all PHPCS errors and warnings
......................................................................

Fix all PHPCS errors and warnings

Change-Id: Idc0f8d506997e30f7e5c29e2c6056991abd6563c
---
M BetaFeatures.php
M BetaFeaturesHooks.php
M includes/ApiListBetaFeatures.php
M includes/BetaFeaturesUtil.php
M includes/HTMLFeatureField.php
M includes/NewHTMLCheckField.php
M includes/SpecialBetaFeatures.php
7 files changed, 32 insertions(+), 18 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BetaFeatures 
refs/changes/04/219804/1

diff --git a/BetaFeatures.php b/BetaFeatures.php
index 110b14e..af0300e 100644
--- a/BetaFeatures.php
+++ b/BetaFeatures.php
@@ -5,7 +5,8 @@
        $wgMessagesDirs['BetaFeatures'] = __DIR__ . '/i18n';
        $wgExtensionMessagesFiles['BetaFeaturesAlias'] = __DIR__ . 
'/BetaFeatures.alias.php';
        /* wfWarn(
-               'Deprecated PHP entry point used for BetaFeatures extension. 
Please use wfLoadExtension instead, ' .
+               'Deprecated PHP entry point used for BetaFeatures extension. ' .
+               'Please use wfLoadExtension instead, ' .
                'see https://www.mediawiki.org/wiki/Extension_registration for 
more details.'
        ); */
        return;
diff --git a/BetaFeaturesHooks.php b/BetaFeaturesHooks.php
index 95ea6a7..de5e8fe 100755
--- a/BetaFeaturesHooks.php
+++ b/BetaFeaturesHooks.php
@@ -143,7 +143,8 @@
                wfRunHooks( 'GetBetaFeatureDependencyHooks', array( &$depHooks 
) );
 
                $saveUser = false;
-               $autoEnrollAll = $user->getOption( 'betafeatures-auto-enroll' ) 
=== HTMLFeatureField::OPTION_ENABLED;
+               $autoEnrollAll =
+                       $user->getOption( 'betafeatures-auto-enroll' ) === 
HTMLFeatureField::OPTION_ENABLED;
                $autoEnroll = array();
 
                foreach ( $betaPrefs as $key => $info ) {
@@ -194,7 +195,9 @@
                                        // A required field isn't present in 
the info array
                                        // we got from the 
GetBetaFeaturePreferences hook.
                                        // Don't add this feature to the form.
-                                       throw new 
BetaFeaturesMissingFieldException( "The field {$field} was missing from the 
beta feature {$key}." );
+                                       throw new 
BetaFeaturesMissingFieldException(
+                                               "The field {$field} was missing 
from the beta feature {$key}."
+                                       );
                                }
                        }
 
@@ -212,7 +215,8 @@
                        $autoEnrollForThisPref = false;
 
                        if ( isset( $info['group'] ) && isset( 
$autoEnroll[$info['group']] ) ) {
-                               $autoEnrollForThisPref = $user->getOption( 
$autoEnroll[$info['group']] ) === HTMLFeatureField::OPTION_ENABLED;
+                               $autoEnrollForThisPref =
+                                       $user->getOption( 
$autoEnroll[$info['group']] ) === HTMLFeatureField::OPTION_ENABLED;
                        }
 
                        $autoEnrollHere = $autoEnrollAll === true || 
$autoEnrollForThisPref === true;
@@ -235,7 +239,7 @@
                                // Check which other beta features are 
required, and fetch their labels
                                if ( isset( 
$prefs[$key]['requirements']['betafeatures'] ) ) {
                                        $requiredPrefs = array();
-                                       foreach( 
$prefs[$key]['requirements']['betafeatures'] as $preference ) {
+                                       foreach ( 
$prefs[$key]['requirements']['betafeatures'] as $preference ) {
                                                if ( !$user->getOption( 
$preference ) ) {
                                                        $requiredPrefs[] = 
$prefs[$preference]['label-message'];
                                                }
@@ -298,7 +302,9 @@
                        $personal_urls = wfArrayInsertAfter( $personal_urls, 
array(
                                'betafeatures' => array(
                                        'text' => wfMessage( 
'betafeatures-toplink' )->text(),
-                                       'href' => SpecialPage::getTitleFor( 
'Preferences', false, 'mw-prefsection-betafeatures' )->getLinkURL(),
+                                       'href' => SpecialPage::getTitleFor(
+                                                       'Preferences', false, 
'mw-prefsection-betafeatures'
+                                               )->getLinkURL(),
                                        'active' => $title->isSpecial( 
'Preferences' ),
                                ),
                        ), 'preferences' );
diff --git a/includes/ApiListBetaFeatures.php b/includes/ApiListBetaFeatures.php
index 03bfb3c..9955a81 100644
--- a/includes/ApiListBetaFeatures.php
+++ b/includes/ApiListBetaFeatures.php
@@ -84,7 +84,8 @@
         */
        public function getExamples() {
                return array(
-                       'api.php?action=query&list=betafeatures&bfcounts=' => 
'Get all available betafeatures and show how many users have enabled them'
+                       'api.php?action=query&list=betafeatures&bfcounts='
+                               => 'Get all available betafeatures and show how 
many users have enabled them'
                );
        }
 
@@ -102,4 +103,3 @@
                return 
'https://www.mediawiki.org/wiki/Extension:BetaFeatures/API';
        }
 }
-
diff --git a/includes/BetaFeaturesUtil.php b/includes/BetaFeaturesUtil.php
index 7119b01..aea076d 100644
--- a/includes/BetaFeaturesUtil.php
+++ b/includes/BetaFeaturesUtil.php
@@ -29,7 +29,8 @@
         * Check if a user has a beta feature enabled.
         *
         * @param User $user The user to check
-        * @param string $feature The key passed back to BetaFeatures from the 
GetBetaFeaturePreferences hook
+        * @param string $feature The key passed back to BetaFeatures
+        *     from the GetBetaFeaturePreferences hook
         * @return bool
         */
        static function isFeatureEnabled( $user, $feature ) {
diff --git a/includes/HTMLFeatureField.php b/includes/HTMLFeatureField.php
index 90c5e4c..9966d97 100644
--- a/includes/HTMLFeatureField.php
+++ b/includes/HTMLFeatureField.php
@@ -53,7 +53,6 @@
                // Close -title-contain
                $html .= Html::closeElement( 'div' );
 
-
                if ( isset( $this->mParams['info-message'] ) ) {
                        $infoLink = $this->mParent->msg( 
$this->mParams['info-message'] )->escaped();
                }
@@ -164,7 +163,7 @@
                                $browserCount = count( 
$this->mParams['requirements']['blacklist'] );
                                $html .= $parent->msg( 
'mw-ui-feature-requirements-browser', $browserCount )->escaped();
                                $html .= Html::openElement( 'ul' );
-                               foreach( 
$this->mParams['requirements']['blacklist'] as $browser => $versions ) {
+                               foreach ( 
$this->mParams['requirements']['blacklist'] as $browser => $versions ) {
                                        $browserString = $browser;
                                        if ( $versions ) {
                                                foreach ( $versions as $version 
) {
@@ -181,7 +180,10 @@
                                $html .= Html::closeElement( 'li' );
                        }
 
-                       if ( isset( 
$this->mParams['requirements']['skin-not-supported'] ) && 
$this->mParams['requirements']['skin-not-supported'] === true ) {
+                       if (
+                               isset( 
$this->mParams['requirements']['skin-not-supported'] ) &&
+                               
$this->mParams['requirements']['skin-not-supported'] === true
+                       ) {
                                $html .= Html::openElement(
                                        'li',
                                        array( 'class' => 
'mw-ui-feature-requirements-skins' )
@@ -189,7 +191,7 @@
                                $skinCount = count( 
$this->mParams['requirements']['skins'] );
                                $html .= $parent->msg( 
'mw-ui-feature-requirements-skins', $skinCount )->escaped();
                                $html .= Html::openElement( 'ul' );
-                               foreach( 
$this->mParams['requirements']['skins'] as $skin ) {
+                               foreach ( 
$this->mParams['requirements']['skins'] as $skin ) {
                                        $html .= Html::element(
                                                'li',
                                                array(),
@@ -208,7 +210,7 @@
                                $featureCount = count( 
$this->mParams['requirements']['betafeatures-messages'] );
                                $html .= $parent->msg( 
'mw-ui-feature-requirements-betafeatures', $featureCount )->escaped();
                                $html .= Html::openElement( 'ul' );
-                               foreach( 
$this->mParams['requirements']['betafeatures-messages'] as $message ) {
+                               foreach ( 
$this->mParams['requirements']['betafeatures-messages'] as $message ) {
                                        $html .= Html::rawElement(
                                                'li',
                                                array(),
@@ -314,7 +316,7 @@
 
                if ( $res === true ) {
                        return HTMLFeatureField::OPTION_ENABLED;
-               } else if ( $res === false ) {
+               } elseif ( $res === false ) {
                        return HTMLFeatureField::OPTION_DISABLED;
                } else {
                        // Dunno what happened, but I'm not gonna fight it.
diff --git a/includes/NewHTMLCheckField.php b/includes/NewHTMLCheckField.php
index 585c65a..1189832 100644
--- a/includes/NewHTMLCheckField.php
+++ b/includes/NewHTMLCheckField.php
@@ -82,7 +82,7 @@
                $out->addModules( 'ext.betaFeatures' );
                $out->addModuleStyles( 'ext.betaFeatures.styles' );
                $out->addModuleStyles( 'mediawiki.ui.checkbox' );
-               $labelHtml = $this->includeLabel ? 
$this->getPostCheckboxLabelHTML() : ''; 
+               $labelHtml = $this->includeLabel ? 
$this->getPostCheckboxLabelHTML() : '';
                return Html::openElement( 'div', array( 'class' => 
$containerClasses ) ) .
                        Xml::check( $this->mName, $value, $attr ) .
                        Html::rawElement( 'label', $labelAttrs ) .
@@ -94,7 +94,11 @@
         * @return string
         */
        protected function getPostCheckboxLabelHTML() {
-               return Html::rawElement( 'label', array( 'for' => $this->mID, 
'class' => 'mw-ui-text-check-label' ), $this->mLabel );
+               return Html::rawElement(
+                       'label',
+                       array( 'for' => $this->mID, 'class' => 
'mw-ui-text-check-label' ),
+                       $this->mLabel
+               );
        }
 
        /**
diff --git a/includes/SpecialBetaFeatures.php b/includes/SpecialBetaFeatures.php
index b81aa3a..9a32bfe 100644
--- a/includes/SpecialBetaFeatures.php
+++ b/includes/SpecialBetaFeatures.php
@@ -8,4 +8,4 @@
        public function getRedirect( $par ) {
                return SpecialPage::getTitleFor( 'Preferences', false, 
'mw-prefsection-betafeatures' );
        }
-}
\ No newline at end of file
+}

-- 
To view, visit https://gerrit.wikimedia.org/r/219804
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idc0f8d506997e30f7e5c29e2c6056991abd6563c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BetaFeatures
Gerrit-Branch: master
Gerrit-Owner: Santhosh <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to