jenkins-bot has submitted this change and it was merged.

Change subject: Add php code sniffer
......................................................................


Add php code sniffer

Change-Id: I298b8b936a2b86deea75c302d88a7391cdb221c9
---
M ConfirmEdit.php
M FancyCaptcha/ApiFancyCaptchaReload.php
M FancyCaptcha/FancyCaptcha.class.php
M FancyCaptcha/FancyCaptcha.php
M MathCaptcha/MathCaptcha.class.php
M MathCaptcha/MathCaptcha.php
M QuestyCaptcha/QuestyCaptcha.class.php
M QuestyCaptcha/QuestyCaptcha.php
M ReCaptcha/ReCaptcha.class.php
M ReCaptcha/ReCaptcha.php
M ReCaptchaNoCaptcha/ReCaptchaNoCaptcha.php
M SimpleCaptcha/Captcha.php
M composer.json
M includes/CaptchaStore.php
M includes/ConfirmEditHooks.php
M includes/specials/SpecialCaptcha.php
M maintenance/GenerateFancyCaptchas.php
A phpcs.xml
18 files changed, 113 insertions(+), 48 deletions(-)

Approvals:
  Florianschmidtwelzow: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/ConfirmEdit.php b/ConfirmEdit.php
index 0990a66..e9b4184 100755
--- a/ConfirmEdit.php
+++ b/ConfirmEdit.php
@@ -108,8 +108,10 @@
 $wgCaptchaTriggersOnNamespace = array();
 
 # Example:
-# $wgCaptchaTriggersOnNamespace[NS_TALK]['create'] = false; //Allow creation 
of talk pages without captchas.
-# $wgCaptchaTriggersOnNamespace[NS_PROJECT]['edit'] = true; //Show captcha 
whenever editing Project pages.
+# // Allow creation of talk pages without captchas
+# $wgCaptchaTriggersOnNamespace[NS_TALK]['create'] = false;
+# // Show captcha whenever editing Project pages.
+# $wgCaptchaTriggersOnNamespace[NS_PROJECT]['edit'] = true;
 
 /**
  * Indicate how to store per-session data required to match up the
diff --git a/FancyCaptcha/ApiFancyCaptchaReload.php 
b/FancyCaptcha/ApiFancyCaptchaReload.php
index 8cd2863..9a331e6 100644
--- a/FancyCaptcha/ApiFancyCaptchaReload.php
+++ b/FancyCaptcha/ApiFancyCaptchaReload.php
@@ -12,7 +12,7 @@
                $captchaIndex = $captcha->getCaptchaIndex();
 
                $result = $this->getResult();
-               $result->addValue( null, $this->getModuleName(), array ( 
'index' => $captchaIndex ) );
+               $result->addValue( null, $this->getModuleName(), array( 'index' 
=> $captchaIndex ) );
                return true;
        }
 
diff --git a/FancyCaptcha/FancyCaptcha.class.php 
b/FancyCaptcha/FancyCaptcha.class.php
index 24b910f..a5c0cc6 100644
--- a/FancyCaptcha/FancyCaptcha.class.php
+++ b/FancyCaptcha/FancyCaptcha.class.php
@@ -91,7 +91,7 @@
         * @param OutputPage $out
         */
        function getForm( OutputPage $out, $tabIndex = 1 ) {
-               global $wgOut, $wgEnableAPI;
+               global $wgEnableAPI;
 
                // Uses addModuleStyles so it is loaded when JS is disabled.
                $out->addModuleStyles( 'ext.confirmEdit.fancyCaptcha.styles' );
@@ -145,7 +145,7 @@
                        ); // tab in before the edit textarea
                        if ( $this->action == 'usercreate' ) {
                                // use raw element, because the message can 
contain links or some other html
-                               $form .= HTML::rawelement( 'small',array(
+                               $form .= HTML::rawelement( 'small', array(
                                                'class' => 
'mw-createacct-captcha-assisted'
                                        ), wfMessage( 
'createacct-imgcaptcha-help' )->parse()
                                );
@@ -229,7 +229,8 @@
 
                $place = mt_rand( 0, count( $dirs ) - 1 ); // pick a random 
subdir
                // In case all dirs are not filled, cycle through next digits...
-               for ( $j = 0; $j < count( $dirs ); $j++ ) {
+               $fancyCount = count( $dirs );
+               for ( $j = 0; $j < $fancyCount; $j++ ) {
                        $char = $dirs[( $place + $j ) % count( $dirs )];
                        $info = $this->pickImageDir( "$directory/$char", 
$levels - 1, $lockouts );
                        if ( $info ) {
@@ -301,7 +302,8 @@
                $backend  = $this->getBackend();
                $place    = mt_rand( 0, count( $files ) - 1 ); // pick a random 
file
                $misses   = 0; // number of files in listing that don't 
actually exist
-               for ( $j = 0; $j < count( $files ); $j++ ) {
+               $fancyImageCount = count( $files );
+               for ( $j = 0; $j < $fancyImageCount; $j++ ) {
                        $entry = $files[( $place + $j ) % count( $files )];
                        if ( preg_match( 
'/^image_([0-9a-f]+)_([0-9a-f]+)\\.png$/', $entry, $matches ) ) {
                                if ( $wgCaptchaDeleteOnSolve ) { // captcha 
will be deleted when solved
diff --git a/FancyCaptcha/FancyCaptcha.php b/FancyCaptcha/FancyCaptcha.php
index 0ac490e..81955bd 100644
--- a/FancyCaptcha/FancyCaptcha.php
+++ b/FancyCaptcha/FancyCaptcha.php
@@ -4,7 +4,8 @@
        // Keep i18n globals so mergeMessageFileList.php doesn't break
        $wgMessagesDirs['FancyCaptcha'] = __DIR__ . '/i18n';
        /* wfWarn(
-               'Deprecated PHP entry point used for FancyCaptcha extension. 
Please use wfLoadExtension instead, ' .
+               'Deprecated PHP entry point used for FancyCaptcha extension. ' .
+               'Please use wfLoadExtension instead, ' .
                'see https://www.mediawiki.org/wiki/Extension_registration for 
more details.'
        ); */
        return;
diff --git a/MathCaptcha/MathCaptcha.class.php 
b/MathCaptcha/MathCaptcha.class.php
index ca8fcc1..45055e6 100644
--- a/MathCaptcha/MathCaptcha.class.php
+++ b/MathCaptcha/MathCaptcha.class.php
@@ -25,7 +25,16 @@
                $index = $this->storeCaptcha( array( 'answer' => $answer ) );
 
                $form = '<table><tr><td>' . $this->fetchMath( $sum ) . '</td>';
-               $form .= '<td>' . Html::input( 'wpCaptchaWord', false, false, 
array( 'tabindex' => $tabIndex, 'autocomplete' => 'off', 'required' ) ) . 
'</td></tr></table>';
+               $form .= '<td>' . Html::input(
+                       'wpCaptchaWord',
+                       false,
+                       false,
+                       array(
+                               'tabindex' => $tabIndex,
+                               'autocomplete' => 'off',
+                               'required'
+                       )
+               ) . '</td></tr></table>';
                $form .= Html::hidden( 'wpCaptchaId', $index );
                return $form;
        }
@@ -45,7 +54,9 @@
                if ( class_exists( 'MathRenderer' ) ) {
                        $math = MathRenderer::getRenderer( $sum, array(), 
MW_MATH_PNG );
                } else {
-                       throw new Exception( 'MathCaptcha requires the Math 
extension for MediaWiki versions 1.18 and above.' );
+                       throw new Exception(
+                               'MathCaptcha requires the Math extension for 
MediaWiki versions 1.18 and above.'
+                       );
                }
                $html = $math->render();
                return preg_replace( '/alt=".*?"/', '', $html );
diff --git a/MathCaptcha/MathCaptcha.php b/MathCaptcha/MathCaptcha.php
index 192b49a..7a5ef8d 100644
--- a/MathCaptcha/MathCaptcha.php
+++ b/MathCaptcha/MathCaptcha.php
@@ -4,7 +4,8 @@
        // Keep i18n globals so mergeMessageFileList.php doesn't break
        $wgMessagesDirs['MathCaptcha'] = __DIR__ . '/i18n';
        /* wfWarn(
-               'Deprecated PHP entry point used for MathCaptcha extension. 
Please use wfLoadExtension instead, ' .
+               'Deprecated PHP entry point used for MathCaptcha extension. ' .
+               'Please use wfLoadExtension instead, ' .
                'see https://www.mediawiki.org/wiki/Extension_registration for 
more details.'
        ); */
        return;
diff --git a/QuestyCaptcha/QuestyCaptcha.class.php 
b/QuestyCaptcha/QuestyCaptcha.class.php
index 9c8daf8..dbe96e7 100644
--- a/QuestyCaptcha/QuestyCaptcha.class.php
+++ b/QuestyCaptcha/QuestyCaptcha.class.php
@@ -31,7 +31,7 @@
        function getCaptcha() {
                global $wgCaptchaQuestions;
 
-               //Backwards compatibility
+               // Backwards compatibility
                if ( $wgCaptchaQuestions === array_values( $wgCaptchaQuestions 
) ) {
                        return $wgCaptchaQuestions[ mt_rand( 0, count( 
$wgCaptchaQuestions ) - 1 ) ];
                }
@@ -44,7 +44,9 @@
        function getForm( OutputPage $out, $tabIndex = 1 ) {
                $captcha = $this->getCaptcha();
                if ( !$captcha ) {
-                       die( "No questions found; set some in LocalSettings.php 
using the format from QuestyCaptcha.php." );
+                       die(
+                               "No questions found; set some in 
LocalSettings.php using the format from QuestyCaptcha.php."
+                       );
                }
                $index = $this->storeCaptcha( $captcha );
                return "<p><label 
for=\"wpCaptchaWord\">{$captcha['question']}</label> " .
@@ -68,7 +70,9 @@
                $text = wfMessage( $name )->text();
                # Obtain a more tailored message, if possible, otherwise, fall 
back to
                # the default for edits
-               return wfMessage( $name, $text )->isDisabled() ? wfMessage( 
'questycaptcha-edit' )->text() : $text;
+               return wfMessage(
+                       $name, $text
+               )->isDisabled() ? wfMessage( 'questycaptcha-edit' )->text() : 
$text;
        }
 
        function showHelp() {
diff --git a/QuestyCaptcha/QuestyCaptcha.php b/QuestyCaptcha/QuestyCaptcha.php
index b83c421..730f4b1 100644
--- a/QuestyCaptcha/QuestyCaptcha.php
+++ b/QuestyCaptcha/QuestyCaptcha.php
@@ -4,7 +4,8 @@
        // Keep i18n globals so mergeMessageFileList.php doesn't break
        $wgMessagesDirs['QuestyCaptcha'] = __DIR__ . '/i18n';
        /* wfWarn(
-               'Deprecated PHP entry point used for QuestyCaptcha extension. 
Please use wfLoadExtension instead, ' .
+               'Deprecated PHP entry point used for QuestyCaptcha extension. ' 
.
+               'Please use wfLoadExtension instead, ' .
                'see https://www.mediawiki.org/wiki/Extension_registration for 
more details.'
        ); */
        return;
diff --git a/ReCaptcha/ReCaptcha.class.php b/ReCaptcha/ReCaptcha.class.php
index 8b261d2..8532afe 100644
--- a/ReCaptcha/ReCaptcha.class.php
+++ b/ReCaptcha/ReCaptcha.class.php
@@ -13,9 +13,13 @@
                global $wgReCaptchaPublicKey, $wgReCaptchaTheme;
 
                $useHttps = ( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] 
== 'on' );
-               $js = 'var RecaptchaOptions = ' . Xml::encodeJsVar( array( 
'theme' => $wgReCaptchaTheme, 'tabindex' => $tabIndex ) );
+               $js = 'var RecaptchaOptions = ' . Xml::encodeJsVar(
+                       array( 'theme' => $wgReCaptchaTheme, 'tabindex' => 
$tabIndex )
+               );
 
-               return Html::inlineScript( $js ) . recaptcha_get_html( 
$wgReCaptchaPublicKey, $this->recaptcha_error, $useHttps );
+               return Html::inlineScript(
+                       $js
+               ) . recaptcha_get_html( $wgReCaptchaPublicKey, 
$this->recaptcha_error, $useHttps );
        }
 
        /**
@@ -27,9 +31,14 @@
        function passCaptcha() {
                global $wgReCaptchaPrivateKey, $wgRequest;
 
-               // API is hardwired to return wpCaptchaId and wpCaptchaWord, so 
use that if the standard two are empty
-               $challenge = $wgRequest->getVal( 'recaptcha_challenge_field', 
$wgRequest->getVal( 'wpCaptchaId' ) );
-               $response = $wgRequest->getVal( 'recaptcha_response_field', 
$wgRequest->getVal( 'wpCaptchaWord' ) );
+               // API is hardwired to return wpCaptchaId and wpCaptchaWord,
+               // so use that if the standard two are empty
+               $challenge = $wgRequest->getVal(
+                       'recaptcha_challenge_field', $wgRequest->getVal( 
'wpCaptchaId' )
+               );
+               $response = $wgRequest->getVal(
+                       'recaptcha_response_field', $wgRequest->getVal( 
'wpCaptchaWord' )
+               );
 
                if ( $response === null ) {
                        // new captcha session
diff --git a/ReCaptcha/ReCaptcha.php b/ReCaptcha/ReCaptcha.php
index 8a649fa..4d88d10 100644
--- a/ReCaptcha/ReCaptcha.php
+++ b/ReCaptcha/ReCaptcha.php
@@ -4,7 +4,8 @@
        // Keep i18n globals so mergeMessageFileList.php doesn't break
        $wgMessagesDirs['ReCaptcha'] = __DIR__ . '/i18n';
        /* wfWarn(
-               'Deprecated PHP entry point used for ReCaptcha extension. 
Please use wfLoadExtension instead, ' .
+               'Deprecated PHP entry point used for ReCaptcha extension. ' .
+               'Please use wfLoadExtension instead, ' .
                'see https://www.mediawiki.org/wiki/Extension_registration for 
more details.'
        ); */
        return;
diff --git a/ReCaptchaNoCaptcha/ReCaptchaNoCaptcha.php 
b/ReCaptchaNoCaptcha/ReCaptchaNoCaptcha.php
index e7528b7..9654dee 100644
--- a/ReCaptchaNoCaptcha/ReCaptchaNoCaptcha.php
+++ b/ReCaptchaNoCaptcha/ReCaptchaNoCaptcha.php
@@ -4,7 +4,8 @@
        // Keep i18n globals so mergeMessageFileList.php doesn't break
        $wgMessagesDirs['ReCaptchaNoCaptcha'] = __DIR__ . '/i18n';
        /* wfWarn(
-               'Deprecated PHP entry point used for ReCaptchaNoCaptcha 
extension. Please use wfLoadExtension instead, ' .
+               'Deprecated PHP entry point used for ReCaptchaNoCaptcha 
extension. ' .
+               'Please use wfLoadExtension instead, ' .
                'see https://www.mediawiki.org/wiki/Extension_registration for 
more details.'
        ); */
        return;
diff --git a/SimpleCaptcha/Captcha.php b/SimpleCaptcha/Captcha.php
index 8299e18..d1170ba 100755
--- a/SimpleCaptcha/Captcha.php
+++ b/SimpleCaptcha/Captcha.php
@@ -153,8 +153,10 @@
                        $captcha = "<div class='captcha'>" .
                                $wgOut->parse( $this->getMessage( 
'createaccount' ) ) .
                                // FIXME: Hardcoded tab index
-                               // Usually, the CAPTCHA is added after the 
E-Mail address field, which actually has 6 as the tabIndex, but
-                               // there may are wikis which allows to mention 
the "real name", which would have 7 as tabIndex, so increase
+                               // Usually, the CAPTCHA is added after the 
E-Mail address field,
+                               // which actually has 6 as the tabIndex, but
+                               // there may are wikis which allows to mention 
the "real name",
+                               // which would have 7 as tabIndex, so increase
                                // 6 by 2 and use it for the CAPTCHA -> 8 (the 
submit button has a tabIndex of 10)
                                $this->getForm( $wgOut, 8 ) .
                                "</div>\n";
@@ -229,7 +231,9 @@
         */
        function isBadLoginTriggered() {
                global $wgMemc, $wgCaptchaTriggers, $wgCaptchaBadLoginAttempts;
-               return $wgCaptchaTriggers['badlogin'] && intval( $wgMemc->get( 
$this->badLoginKey() ) ) >= $wgCaptchaBadLoginAttempts;
+               return $wgCaptchaTriggers['badlogin'] && intval(
+                       $wgMemc->get( $this->badLoginKey() )
+               ) >= $wgCaptchaBadLoginAttempts;
        }
 
        /**
@@ -303,7 +307,9 @@
         * @return bool true if the captcha should run
         */
        function shouldCheck( WikiPage $page, $content, $section, $context, 
$oldtext = null ) {
+               // @codingStandardsIgnoreStart
                global $ceAllowConfirmedEmail;
+               // @codingStandardsIgnoreEnd
 
                if ( !$context instanceof IContextSource ) {
                        $context = RequestContext::getMain();
@@ -349,7 +355,7 @@
                        return true;
                }
 
-               if ( $this->captchaTriggers( $title, 'create' )  && 
!$title->exists() ) {
+               if ( $this->captchaTriggers( $title, 'create' ) && 
!$title->exists() ) {
                        // Check if creating a page
                        $this->trigger = sprintf( "Create trigger by '%s' at 
[[%s]]",
                                $user->getName(),
@@ -359,9 +365,12 @@
                        return true;
                }
 
-               // The following checks are expensive and should be done only, 
if we can assume, that the edit will be saved
+               // The following checks are expensive and should be done only,
+               // if we can assume, that the edit will be saved
                if ( !$request->wasPosted() ) {
-                       wfDebug( "ConfirmEdit: request not posted, assuming 
that no content will be saved -> no CAPTCHA check" );
+                       wfDebug(
+                               "ConfirmEdit: request not posted, assuming that 
no content will be saved -> no CAPTCHA check"
+                       );
                        return false;
                }
 
@@ -402,7 +411,9 @@
                global $wgCaptchaRegexes;
                if ( $newtext !== null && $wgCaptchaRegexes ) {
                        if ( !is_array( $wgCaptchaRegexes ) ) {
-                               throw new UnexpectedValueException( 
'$wgCaptchaRegexes is required to be an array, ' . gettype( $wgCaptchaRegexes ) 
. ' given.' );
+                               throw new UnexpectedValueException(
+                                       '$wgCaptchaRegexes is required to be an 
array, ' . gettype( $wgCaptchaRegexes ) . ' given.'
+                               );
                        }
                        // Custom regex checks. Reuse $oldtext if set above.
                        $oldtext = isset( $oldtext ) ? $oldtext : 
$this->loadText( $title, $section );
@@ -606,7 +617,8 @@
                                // otherwise it's an unknown page where this 
function is called from
                                $title = 'unknown';
                        }
-                       // log this error, it could be a problem in another 
extension, edits should always have a WikiPage if
+                       // log this error, it could be a problem in another 
extension,
+                       // edits should always have a WikiPage if
                        // they go through EditFilterMergedContent.
                        wfDebug( __METHOD__ . ': Skipped ConfirmEdit check: No 
WikiPage for title ' . $title );
                        return true;
@@ -660,7 +672,9 @@
                if ( $this->needCreateAccountCaptcha() ) {
                        $this->trigger = "new account '" . $u->getName() . "'";
                        $success = $this->passCaptchaLimited();
-                       LoggerFactory::getInstance( 'authmanager' )->info( 
'Captcha submitted on account creation', array(
+                       LoggerFactory::getInstance(
+                               'authmanager'
+                       )->info( 'Captcha submitted on account creation', array(
                                'event' => 'captcha.submit',
                                'type' => 'accountcreation',
                                'successful' => $success,
@@ -834,7 +848,8 @@
        function passCaptcha() {
                global $wgRequest;
 
-               // Don't check the same CAPTCHA twice in one session, if the 
CAPTCHA was already checked - Bug T94276
+               // Don't check the same CAPTCHA twice in one session,
+               // if the CAPTCHA was already checked - Bug T94276
                if ( isset( $this->captchaSolved ) ) {
                        return $this->captchaSolved;
                }
@@ -1005,7 +1020,9 @@
                                                $this->addCaptchaAPI( $result );
                                                $result['result'] = 
'NeedCaptcha';
 
-                                               LoggerFactory::getInstance( 
'authmanager' )->info( 'Captcha data added in account creation API', array(
+                                               LoggerFactory::getInstance(
+                                                       'authmanager'
+                                               )->info( 'Captcha data added in 
account creation API', array(
                                                        'event' => 
'captcha.display',
                                                        'type' => 
'accountcreation',
                                                ) );
diff --git a/composer.json b/composer.json
index f2883f7..4365e8a 100644
--- a/composer.json
+++ b/composer.json
@@ -1,10 +1,12 @@
 {
        "require-dev": {
-               "jakub-onderka/php-parallel-lint": "0.9"
+               "jakub-onderka/php-parallel-lint": "0.9",
+               "mediawiki/mediawiki-codesniffer": "0.4.0"
        },
        "scripts": {
                "test": [
-                       "parallel-lint . --exclude vendor"
+                       "parallel-lint . --exclude vendor",
+                       "phpcs -p -s"
                ]
        }
 }
diff --git a/includes/CaptchaStore.php b/includes/CaptchaStore.php
index 7580071..17683a3 100755
--- a/includes/CaptchaStore.php
+++ b/includes/CaptchaStore.php
@@ -6,26 +6,26 @@
         * @param  $index String
         * @param  $info String the captcha result
         */
-       public abstract function store( $index, $info );
+       abstract public function store( $index, $info );
 
        /**
         * Retrieve the answer for a given captcha
         * @param  $index String
         * @return String
         */
-       public abstract function retrieve( $index );
+       abstract public function retrieve( $index );
 
        /**
         * Delete a result once the captcha has been used, so it cannot be 
reused
         * @param  $index
         */
-       public abstract function clear( $index );
+       abstract public function clear( $index );
 
        /**
         * Whether this type of CaptchaStore needs cookies
         * @return Bool
         */
-       public abstract function cookiesNeeded();
+       abstract public function cookiesNeeded();
 
        /**
         * The singleton instance
@@ -39,7 +39,7 @@
         * @throws Exception
         * @return CaptchaStore
         */
-       public final static function get() {
+       final public static function get() {
                if ( !self::$instance instanceof self ) {
                        global $wgCaptchaStorageClass;
                        if ( in_array( 'CaptchaStore', class_parents( 
$wgCaptchaStorageClass ) ) ) {
@@ -54,7 +54,8 @@
        /**
         * Protected constructor: no creating instances except through the 
factory method above
         */
-       protected function __construct() {}
+       protected function __construct() {
+       }
 }
 
 class CaptchaSessionStore extends CaptchaStore {
diff --git a/includes/ConfirmEditHooks.php b/includes/ConfirmEditHooks.php
index 41c990f..de5b36e 100644
--- a/includes/ConfirmEditHooks.php
+++ b/includes/ConfirmEditHooks.php
@@ -145,7 +145,7 @@
         * FIXME: This should be done in a better way, e.g. only load the 
libraray, if really needed.
         */
        public static function onReCaptchaSetup() {
-               require_once( __DIR__ . '/../ReCaptcha/recaptchalib.php' );
+               require_once ( __DIR__ . '/../ReCaptcha/recaptchalib.php' );
        }
 
        /**
@@ -154,7 +154,9 @@
         */
        public static function efReCaptcha() {
                global $wgReCaptchaPublicKey, $wgReCaptchaPrivateKey;
+               // @codingStandardsIgnoreStart
                global $recaptcha_public_key, $recaptcha_private_key;
+               // @codingStandardsIgnoreEnd
                global $wgServerName;
 
                // Backwards compatibility
@@ -166,9 +168,10 @@
                }
 
                if ( $wgReCaptchaPublicKey == '' || $wgReCaptchaPrivateKey == 
'' ) {
-                       die ( 'You need to set $wgReCaptchaPrivateKey and 
$wgReCaptchaPublicKey in LocalSettings.php to ' .
+                       die (
+                               'You need to set $wgReCaptchaPrivateKey and 
$wgReCaptchaPublicKey in LocalSettings.php to ' .
                                "use the reCAPTCHA plugin. You can sign up for 
a key <a href='" .
-                               htmlentities( recaptcha_get_signup_url ( 
$wgServerName, "mediawiki" ) ) . "'>here</a>." );
+                               htmlentities( recaptcha_get_signup_url( 
$wgServerName, "mediawiki" ) ) . "'>here</a>." );
                }
        }
 }
diff --git a/includes/specials/SpecialCaptcha.php 
b/includes/specials/SpecialCaptcha.php
index 6330579..f188ae2 100644
--- a/includes/specials/SpecialCaptcha.php
+++ b/includes/specials/SpecialCaptcha.php
@@ -9,7 +9,7 @@
 
                $instance = ConfirmEditHooks::getInstance();
 
-               switch( $par ) {
+               switch ( $par ) {
                        case "image":
                                if ( method_exists( $instance, 'showImage' ) ) {
                                        return $instance->showImage();
diff --git a/maintenance/GenerateFancyCaptchas.php 
b/maintenance/GenerateFancyCaptchas.php
index 4d253bf..17c0dcf 100644
--- a/maintenance/GenerateFancyCaptchas.php
+++ b/maintenance/GenerateFancyCaptchas.php
@@ -24,10 +24,10 @@
 if ( getenv( 'MW_INSTALL_PATH' ) ) {
        $IP = getenv( 'MW_INSTALL_PATH' );
 } else {
-       $IP = dirname(__FILE__).'/../../..';
+       $IP = dirname( __FILE__ ).'/../../..';
 }
 
-require_once( "$IP/maintenance/Maintenance.php" );
+require_once ( "$IP/maintenance/Maintenance.php" );
 
 /**
  * Maintenance script to change the password of a given user.
@@ -127,4 +127,4 @@
 }
 
 $maintClass = "GenerateFancyCaptchas";
-require_once( RUN_MAINTENANCE_IF_MAIN );
+require_once ( RUN_MAINTENANCE_IF_MAIN );
diff --git a/phpcs.xml b/phpcs.xml
new file mode 100644
index 0000000..194bbc2
--- /dev/null
+++ b/phpcs.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<ruleset>
+       <rule ref="vendor/mediawiki/mediawiki-codesniffer/MediaWiki"/>
+       <file>.</file>
+       <arg name="extensions" value="php,php5,inc"/>
+       <arg name="encoding" value="utf8"/>
+       <exclude-pattern>ReCaptcha/recaptchalib.php</exclude-pattern>
+       <exclude-pattern>vendor</exclude-pattern>
+</ruleset>

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I298b8b936a2b86deea75c302d88a7391cdb221c9
Gerrit-PatchSet: 8
Gerrit-Project: mediawiki/extensions/ConfirmEdit
Gerrit-Branch: master
Gerrit-Owner: Paladox <[email protected]>
Gerrit-Reviewer: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Paladox <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to