[MediaWiki-commits] [Gerrit] mediawiki...SecurePoll[master]: Add phpcs and make pass
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/358066 ) Change subject: Add phpcs and make pass .. Add phpcs and make pass Change-Id: Iccc25342734d12928b98d49e7dae02d64136607c --- M auth-api.php M composer.json M includes/SecurePollHooks.php M includes/crypt/Crypt.php M includes/entities/Election.php M includes/main/Context.php M includes/main/SpecialSecurePoll.php M includes/main/Store.php M includes/user/Auth.php M includes/user/Voter.php A phpcs.xml 11 files changed, 66 insertions(+), 22 deletions(-) Approvals: Huji: Looks good to me, approved jenkins-bot: Verified diff --git a/auth-api.php b/auth-api.php index ef06d1e..8e4fe0a 100644 --- a/auth-api.php +++ b/auth-api.php @@ -9,7 +9,7 @@ } chdir( $IP ); -require( "$IP/includes/WebStart.php" ); +require "$IP/includes/WebStart.php"; if ( !class_exists( 'SecurePoll_RemoteMWAuth' ) ) { header( 'HTTP/1.1 500 Internal Server Error' ); @@ -40,4 +40,3 @@ $auth = $context->newAuth( 'local' ); $status = Status::newGood( $auth->getUserParams( $user ) ); echo serialize( $status ); - diff --git a/composer.json b/composer.json index 686b65b..b8f68fb 100644 --- a/composer.json +++ b/composer.json @@ -1,11 +1,14 @@ { "require-dev": { "jakub-onderka/php-parallel-lint": "0.9.2", - "jakub-onderka/php-console-highlighter": "0.3.2" + "jakub-onderka/php-console-highlighter": "0.3.2", + "mediawiki/mediawiki-codesniffer": "0.7.2" }, "scripts": { + "fix": "phpcbf", "test": [ - "parallel-lint . --exclude vendor" + "parallel-lint . --exclude vendor", + "phpcs -p -s" ] } } diff --git a/includes/SecurePollHooks.php b/includes/SecurePollHooks.php index adb2275..204aad0 100644 --- a/includes/SecurePollHooks.php +++ b/includes/SecurePollHooks.php @@ -79,7 +79,7 @@ */ public static function onContentHandlerDefaultModelFor( $title, &$model ) { global $wgSecurePollUseNamespace; - if( $wgSecurePollUseNamespace && $title->getNamespace() == NS_SECUREPOLL ) { + if ( $wgSecurePollUseNamespace && $title->getNamespace() == NS_SECUREPOLL ) { $model = 'SecurePoll'; return false; } diff --git a/includes/crypt/Crypt.php b/includes/crypt/Crypt.php index 7d36b00..7734665 100644 --- a/includes/crypt/Crypt.php +++ b/includes/crypt/Crypt.php @@ -244,7 +244,9 @@ if ( !$dir ) { return; } + // @codingStandardsIgnoreStart while ( false !== ( $file = readdir( $dir ) ) ) { + // @codingStandardsIgnoreEnd if ( $file == '.' || $file == '..' ) { continue; } diff --git a/includes/entities/Election.php b/includes/entities/Election.php index 89a3b0c..08cb5a2 100644 --- a/includes/entities/Election.php +++ b/includes/entities/Election.php @@ -127,12 +127,16 @@ /** * Get the start date in MW internal form. */ - function getStartDate() { return $this->startDate; } + function getStartDate() { + return $this->startDate; + } /** * Get the end date in MW internal form. */ - function getEndDate() { return $this->endDate; } + function getEndDate() { + return $this->endDate; + } /** * Returns true if the election has started. @@ -194,7 +198,7 @@ $edits = isset( $props['edit-count'] ) ? $props['edit-count'] : 0; if ( $minEdits && $edits < $minEdits ) { $status->fatal( 'securepoll-too-few-edits', - $wgLang->formatNum( $minEdits), $wgLang->formatNum( $edits ) ); + $wgLang->formatNum( $minEdits ), $wgLang->formatNum( $edits ) ); } // Registration date diff --git a/includes/main/Context.php b/includes/main/Context.php index 1d7c3cf..6e50517 100644 --- a/includes/main/Context.php +++ b/includes/main/Context.php @@ -109,7 +109,7 @@ * @return SecurePoll_Election */ function getElection( $id ) { - if( !isset( $this->electionCache[$id] ) ) { + if ( !isset( $this->electionCache[$id] ) ) { $info = $this->getStore()->getElectionInfo( array( $id ) ); if ( $info ) { $this->electionCache[$id] = $this->newElection( reset( $info ) ); diff --git a/includes/main/SpecialSecurePoll.php b/includes/main/SpecialSecurePoll.php index
[MediaWiki-commits] [Gerrit] mediawiki...SecurePoll[master]: Add phpcs and make pass
Umherirrender has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/358066 ) Change subject: Add phpcs and make pass .. Add phpcs and make pass Change-Id: Iccc25342734d12928b98d49e7dae02d64136607c --- M auth-api.php M composer.json M includes/SecurePollHooks.php M includes/crypt/Crypt.php M includes/entities/Election.php M includes/main/Context.php M includes/main/SpecialSecurePoll.php M includes/main/Store.php M includes/user/Auth.php M includes/user/Voter.php A phpcs.xml 11 files changed, 66 insertions(+), 22 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SecurePoll refs/changes/66/358066/1 diff --git a/auth-api.php b/auth-api.php index ef06d1e..8e4fe0a 100644 --- a/auth-api.php +++ b/auth-api.php @@ -9,7 +9,7 @@ } chdir( $IP ); -require( "$IP/includes/WebStart.php" ); +require "$IP/includes/WebStart.php"; if ( !class_exists( 'SecurePoll_RemoteMWAuth' ) ) { header( 'HTTP/1.1 500 Internal Server Error' ); @@ -40,4 +40,3 @@ $auth = $context->newAuth( 'local' ); $status = Status::newGood( $auth->getUserParams( $user ) ); echo serialize( $status ); - diff --git a/composer.json b/composer.json index 686b65b..b8f68fb 100644 --- a/composer.json +++ b/composer.json @@ -1,11 +1,14 @@ { "require-dev": { "jakub-onderka/php-parallel-lint": "0.9.2", - "jakub-onderka/php-console-highlighter": "0.3.2" + "jakub-onderka/php-console-highlighter": "0.3.2", + "mediawiki/mediawiki-codesniffer": "0.7.2" }, "scripts": { + "fix": "phpcbf", "test": [ - "parallel-lint . --exclude vendor" + "parallel-lint . --exclude vendor", + "phpcs -p -s" ] } } diff --git a/includes/SecurePollHooks.php b/includes/SecurePollHooks.php index adb2275..204aad0 100644 --- a/includes/SecurePollHooks.php +++ b/includes/SecurePollHooks.php @@ -79,7 +79,7 @@ */ public static function onContentHandlerDefaultModelFor( $title, &$model ) { global $wgSecurePollUseNamespace; - if( $wgSecurePollUseNamespace && $title->getNamespace() == NS_SECUREPOLL ) { + if ( $wgSecurePollUseNamespace && $title->getNamespace() == NS_SECUREPOLL ) { $model = 'SecurePoll'; return false; } diff --git a/includes/crypt/Crypt.php b/includes/crypt/Crypt.php index 7d36b00..7734665 100644 --- a/includes/crypt/Crypt.php +++ b/includes/crypt/Crypt.php @@ -244,7 +244,9 @@ if ( !$dir ) { return; } + // @codingStandardsIgnoreStart while ( false !== ( $file = readdir( $dir ) ) ) { + // @codingStandardsIgnoreEnd if ( $file == '.' || $file == '..' ) { continue; } diff --git a/includes/entities/Election.php b/includes/entities/Election.php index 89a3b0c..08cb5a2 100644 --- a/includes/entities/Election.php +++ b/includes/entities/Election.php @@ -127,12 +127,16 @@ /** * Get the start date in MW internal form. */ - function getStartDate() { return $this->startDate; } + function getStartDate() { + return $this->startDate; + } /** * Get the end date in MW internal form. */ - function getEndDate() { return $this->endDate; } + function getEndDate() { + return $this->endDate; + } /** * Returns true if the election has started. @@ -194,7 +198,7 @@ $edits = isset( $props['edit-count'] ) ? $props['edit-count'] : 0; if ( $minEdits && $edits < $minEdits ) { $status->fatal( 'securepoll-too-few-edits', - $wgLang->formatNum( $minEdits), $wgLang->formatNum( $edits ) ); + $wgLang->formatNum( $minEdits ), $wgLang->formatNum( $edits ) ); } // Registration date diff --git a/includes/main/Context.php b/includes/main/Context.php index 1d7c3cf..6e50517 100644 --- a/includes/main/Context.php +++ b/includes/main/Context.php @@ -109,7 +109,7 @@ * @return SecurePoll_Election */ function getElection( $id ) { - if( !isset( $this->electionCache[$id] ) ) { + if ( !isset( $this->electionCache[$id] ) ) { $info = $this->getStore()->getElectionInfo( array( $id ) ); if ( $info ) { $this->electionCache[$id] = $this->newElection( reset( $info ) ); diff --git a/includes/main/SpecialSecurePoll.php