[MediaWiki-commits] [Gerrit] mediawiki...SecurePoll[master]: Improve some parameter docs

2017-10-14 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/384261 )

Change subject: Improve some parameter docs
..


Improve some parameter docs

Change-Id: Ifedd1d93be65d8f6aac6605f986f1b5787aac789
---
M cli/delete.php
M cli/import.php
M cli/wm-scripts/bv2013/doSpam.php
M cli/wm-scripts/bv2013/dumpMetaTranslations.php
M cli/wm-scripts/bv2013/voterList.php
M cli/wm-scripts/bv2015/voterList.php
M cli/wm-scripts/bv2017/voterList.php
M includes/SecurePollHooks.php
M includes/ballots/ApprovalBallot.php
M includes/ballots/Ballot.php
M includes/ballots/ChooseBallot.php
M includes/ballots/PreferentialBallot.php
M includes/ballots/RadioRangeBallot.php
M includes/ballots/RadioRangeCommentBallot.php
M includes/crypt/Crypt.php
M includes/crypt/Random.php
M includes/entities/Election.php
M includes/entities/Entity.php
M includes/entities/Option.php
M includes/entities/Question.php
M includes/main/Context.php
M includes/main/SpecialSecurePoll.php
M includes/main/Store.php
M includes/pages/ActionPage.php
M includes/pages/CreatePage.php
M includes/pages/DetailsPage.php
M includes/pages/DumpPage.php
M includes/pages/EntryPage.php
M includes/pages/ListPage.php
M includes/pages/TallyPage.php
M includes/pages/TranslatePage.php
M includes/pages/VotePage.php
M includes/pages/VoterEligibilityPage.php
M includes/talliers/CommentDumper.php
M includes/talliers/ElectionTallier.php
M includes/talliers/PluralityTallier.php
M includes/talliers/SchulzeTallier.php
M includes/talliers/Tallier.php
M includes/user/Voter.php
M phpcs.xml
40 files changed, 309 insertions(+), 163 deletions(-)

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



diff --git a/cli/delete.php b/cli/delete.php
index 60ae029..5f18f3b 100644
--- a/cli/delete.php
+++ b/cli/delete.php
@@ -23,7 +23,8 @@
 exit( $success ? 0 : 1 );
 
 /**
- * @param $electionId int|string
+ * @param int|string $electionId
+ * @return bool
  */
 function spDeleteElection( $electionId ) {
$dbw = wfGetDB( DB_MASTER );
diff --git a/cli/import.php b/cli/import.php
index 3a5f7c7..88e2b1a 100644
--- a/cli/import.php
+++ b/cli/import.php
@@ -49,8 +49,8 @@
 exit( $success ? 0 : 1 );
 
 /**
- * @param $fileName string
- * @param $options
+ * @param string $fileName
+ * @param array $options
  * @return bool
  */
 function spImportDump( $fileName, $options ) {
@@ -113,7 +113,7 @@
 }
 
 /**
- * @param $electionId int|string
+ * @param int|string $electionId
  */
 function spDeleteElection( $electionId ) {
$dbw = wfGetDB( DB_MASTER );
@@ -149,8 +149,8 @@
 }
 
 /**
- * @param $type string
- * @param $id string
+ * @param string $type
+ * @param string $id
  */
 function spInsertEntity( $type, $id ) {
$dbw = wfGetDB( DB_MASTER );
@@ -164,8 +164,8 @@
 }
 
 /**
- * @param $store SecurePoll_Store
- * @param $electionInfo
+ * @param SecurePoll_Store $store
+ * @param array $electionInfo
  * @return bool
  */
 function spImportConfiguration( $store, $electionInfo ) {
@@ -239,8 +239,8 @@
 }
 
 /**
- * @param $store SecurePoll_Store
- * @param $entityIds
+ * @param SecurePoll_Store $store
+ * @param array $entityIds
  */
 function spInsertMessages( $store, $entityIds ) {
$langs = $store->getLangList( $entityIds );
@@ -265,8 +265,8 @@
 }
 
 /**
- * @param $store SecurePoll_Store
- * @param $electionInfo
+ * @param SecurePoll_Store $store
+ * @param array $electionInfo
  * @return bool
  */
 function spUpdateMessages( $store, $electionInfo ) {
diff --git a/cli/wm-scripts/bv2013/doSpam.php b/cli/wm-scripts/bv2013/doSpam.php
index 0d95134..c473016 100644
--- a/cli/wm-scripts/bv2013/doSpam.php
+++ b/cli/wm-scripts/bv2013/doSpam.php
@@ -188,8 +188,8 @@
 /**
  * Checks for ineligibility due to blocks or groups
  *
- * @param $wiki
- * @param $usersToCheck
+ * @param string $wiki
+ * @param int[] $usersToCheck
  */
 function runChecks( $wiki, $usersToCheck /* user ID */ ) {
global $users;
diff --git a/cli/wm-scripts/bv2013/dumpMetaTranslations.php 
b/cli/wm-scripts/bv2013/dumpMetaTranslations.php
index 7b714c3..799378a 100644
--- a/cli/wm-scripts/bv2013/dumpMetaTranslations.php
+++ b/cli/wm-scripts/bv2013/dumpMetaTranslations.php
@@ -107,7 +107,7 @@
 // --
 
 /**
- * @param $lang string
+ * @param string $lang
  * @return array|bool
  */
 function spGetMetaTranslations( $lang ) {
@@ -185,8 +185,8 @@
 }
 
 /**
- * @param $messages array
- * @param $entity
+ * @param array $messages
+ * @param array $entity
  * @return string
  */
 function spFormatEntityMessages( $messages, $entity ) {
diff --git a/cli/wm-scripts/bv2013/voterList.php 
b/cli/wm-scripts/bv2013/voterList.php
index c62c4f4..3b5c144 100644
--- a/cli/wm-scripts/bv2013/voterList.php
+++ b/cli/wm-scripts/bv2013/voterList.php
@@ -45,7 +45,7 @@
 echo wfWikiID() . " qualified \t$numQualified\n";
 
 /**
- * @param $users array
+ * @param arra

[MediaWiki-commits] [Gerrit] mediawiki...SecurePoll[master]: Improve some parameter docs

2017-10-14 Thread Umherirrender (Code Review)
Umherirrender has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/384261 )

Change subject: Improve some parameter docs
..

Improve some parameter docs

Change-Id: Ifedd1d93be65d8f6aac6605f986f1b5787aac789
---
M cli/delete.php
M cli/import.php
M cli/wm-scripts/bv2013/doSpam.php
M cli/wm-scripts/bv2013/dumpMetaTranslations.php
M cli/wm-scripts/bv2013/voterList.php
M cli/wm-scripts/bv2015/voterList.php
M cli/wm-scripts/bv2017/voterList.php
M includes/SecurePollHooks.php
M includes/ballots/ApprovalBallot.php
M includes/ballots/Ballot.php
M includes/ballots/ChooseBallot.php
M includes/ballots/PreferentialBallot.php
M includes/ballots/RadioRangeBallot.php
M includes/ballots/RadioRangeCommentBallot.php
M includes/crypt/Crypt.php
M includes/crypt/Random.php
M includes/entities/Election.php
M includes/entities/Entity.php
M includes/entities/Option.php
M includes/entities/Question.php
M includes/main/Context.php
M includes/main/SpecialSecurePoll.php
M includes/main/Store.php
M includes/pages/ActionPage.php
M includes/pages/CreatePage.php
M includes/pages/DetailsPage.php
M includes/pages/DumpPage.php
M includes/pages/EntryPage.php
M includes/pages/ListPage.php
M includes/pages/TallyPage.php
M includes/pages/TranslatePage.php
M includes/pages/VotePage.php
M includes/pages/VoterEligibilityPage.php
M includes/talliers/CommentDumper.php
M includes/talliers/ElectionTallier.php
M includes/talliers/PluralityTallier.php
M includes/talliers/SchulzeTallier.php
M includes/talliers/Tallier.php
M includes/user/Voter.php
M phpcs.xml
40 files changed, 309 insertions(+), 163 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SecurePoll 
refs/changes/61/384261/1

diff --git a/cli/delete.php b/cli/delete.php
index 60ae029..5f18f3b 100644
--- a/cli/delete.php
+++ b/cli/delete.php
@@ -23,7 +23,8 @@
 exit( $success ? 0 : 1 );
 
 /**
- * @param $electionId int|string
+ * @param int|string $electionId
+ * @return bool
  */
 function spDeleteElection( $electionId ) {
$dbw = wfGetDB( DB_MASTER );
diff --git a/cli/import.php b/cli/import.php
index 3a5f7c7..88e2b1a 100644
--- a/cli/import.php
+++ b/cli/import.php
@@ -49,8 +49,8 @@
 exit( $success ? 0 : 1 );
 
 /**
- * @param $fileName string
- * @param $options
+ * @param string $fileName
+ * @param array $options
  * @return bool
  */
 function spImportDump( $fileName, $options ) {
@@ -113,7 +113,7 @@
 }
 
 /**
- * @param $electionId int|string
+ * @param int|string $electionId
  */
 function spDeleteElection( $electionId ) {
$dbw = wfGetDB( DB_MASTER );
@@ -149,8 +149,8 @@
 }
 
 /**
- * @param $type string
- * @param $id string
+ * @param string $type
+ * @param string $id
  */
 function spInsertEntity( $type, $id ) {
$dbw = wfGetDB( DB_MASTER );
@@ -164,8 +164,8 @@
 }
 
 /**
- * @param $store SecurePoll_Store
- * @param $electionInfo
+ * @param SecurePoll_Store $store
+ * @param array $electionInfo
  * @return bool
  */
 function spImportConfiguration( $store, $electionInfo ) {
@@ -239,8 +239,8 @@
 }
 
 /**
- * @param $store SecurePoll_Store
- * @param $entityIds
+ * @param SecurePoll_Store $store
+ * @param array $entityIds
  */
 function spInsertMessages( $store, $entityIds ) {
$langs = $store->getLangList( $entityIds );
@@ -265,8 +265,8 @@
 }
 
 /**
- * @param $store SecurePoll_Store
- * @param $electionInfo
+ * @param SecurePoll_Store $store
+ * @param array $electionInfo
  * @return bool
  */
 function spUpdateMessages( $store, $electionInfo ) {
diff --git a/cli/wm-scripts/bv2013/doSpam.php b/cli/wm-scripts/bv2013/doSpam.php
index 0d95134..c473016 100644
--- a/cli/wm-scripts/bv2013/doSpam.php
+++ b/cli/wm-scripts/bv2013/doSpam.php
@@ -188,8 +188,8 @@
 /**
  * Checks for ineligibility due to blocks or groups
  *
- * @param $wiki
- * @param $usersToCheck
+ * @param string $wiki
+ * @param int[] $usersToCheck
  */
 function runChecks( $wiki, $usersToCheck /* user ID */ ) {
global $users;
diff --git a/cli/wm-scripts/bv2013/dumpMetaTranslations.php 
b/cli/wm-scripts/bv2013/dumpMetaTranslations.php
index 7b714c3..799378a 100644
--- a/cli/wm-scripts/bv2013/dumpMetaTranslations.php
+++ b/cli/wm-scripts/bv2013/dumpMetaTranslations.php
@@ -107,7 +107,7 @@
 // --
 
 /**
- * @param $lang string
+ * @param string $lang
  * @return array|bool
  */
 function spGetMetaTranslations( $lang ) {
@@ -185,8 +185,8 @@
 }
 
 /**
- * @param $messages array
- * @param $entity
+ * @param array $messages
+ * @param array $entity
  * @return string
  */
 function spFormatEntityMessages( $messages, $entity ) {
diff --git a/cli/wm-scripts/bv2013/voterList.php 
b/cli/wm-scripts/bv2013/voterList.php
index c62c4f4..3b5c144 100644
--- a/cli/wm-scripts/bv2013/voterList.php
+++ b/cli/wm-scripts/bv2013/voterList.php
@@ -45,7 +45,7 @@
 echo wfWikiID() . " qualified \t$numQualified\n";
 
 /**
- * @param $us

[MediaWiki-commits] [Gerrit] mediawiki...SecurePoll[master]: Improve some parameter docs

2017-08-10 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/371004 )

Change subject: Improve some parameter docs
..


Improve some parameter docs

Change-Id: Ifc9967f1e0470a86e56f9d883ed13c0e55125bf3
---
M composer.json
M includes/main/Context.php
M includes/main/Store.php
M includes/pages/ListPage.php
M includes/user/Auth.php
M phpcs.xml
6 files changed, 25 insertions(+), 24 deletions(-)

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



diff --git a/composer.json b/composer.json
index bf202bf..fd295f4 100644
--- a/composer.json
+++ b/composer.json
@@ -7,7 +7,7 @@
"scripts": {
"fix": "phpcbf",
"test": [
-   "parallel-lint . --exclude vendor",
+   "parallel-lint . --exclude vendor --exclude 
node_modules",
"phpcs -p -s"
]
}
diff --git a/includes/main/Context.php b/includes/main/Context.php
index 1bd6f08..ac14d06 100644
--- a/includes/main/Context.php
+++ b/includes/main/Context.php
@@ -248,7 +248,7 @@
/**
 * Get a database object, or throw an exception if the current store 
object
 * does not support database operations.
-* @param integer $index DB_MASTER or DB_REPLICA
+* @param int $index DB_MASTER or DB_REPLICA
 * @return DatabaseBase
 */
function getDB( $index = DB_MASTER ) {
diff --git a/includes/main/Store.php b/includes/main/Store.php
index 8f851cf..4934f47 100644
--- a/includes/main/Store.php
+++ b/includes/main/Store.php
@@ -35,8 +35,8 @@
 
/**
 * Get the type of one or more SecurePoll entities.
-* @param $ids Int
-* @return String
+* @param int $id
+* @return string
 */
function getEntityType( $id );
 
@@ -60,7 +60,7 @@
 
/**
 * Get a database connection object.
-* @param integer $index DB_MASTER or DB_REPLICA
+* @param int $index DB_MASTER or DB_REPLICA
 */
function getDB( $index = DB_MASTER );
 
diff --git a/includes/pages/ListPage.php b/includes/pages/ListPage.php
index 710670a..d3cbddc 100644
--- a/includes/pages/ListPage.php
+++ b/includes/pages/ListPage.php
@@ -10,7 +10,7 @@
 
/**
 * Execute the subpage.
-* @param $params array Array of subpage parameters.
+* @param array $params Array of subpage parameters.
 */
public function execute( $params ) {
$out = $this->specialPage->getOutput();
@@ -132,9 +132,9 @@
 
/**
 * The strike/unstrike backend.
-* @param $action string strike or unstrike
-* @param $voteId integer The vote ID
-* @param $reason string The reason
+* @param string $action strike or unstrike
+* @param int $voteId The vote ID
+* @param string $reason The reason
 */
public function strike( $action, $voteId, $reason ) {
$dbw = $this->context->getDB();
diff --git a/includes/user/Auth.php b/includes/user/Auth.php
index 92ea666..d9a5b53 100644
--- a/includes/user/Auth.php
+++ b/includes/user/Auth.php
@@ -19,6 +19,7 @@
 * Create an auth object of the given type
 * @param SecurePoll_Context $context
 * @param string $type
+* @return SecurePoll_LocalAuth|SecurePoll_RemoteMWAuth
 * @throws MWException
 */
static function factory( $context, $type ) {
@@ -49,7 +50,7 @@
/**
 * Create a voter transparently, without user interaction.
 * Sessions authorized against local accounts are created this way.
-* @param $election SecurePoll_Election
+* @param SecurePoll_Election $election
 * @return Status
 */
function autoLogin( $election ) {
@@ -58,7 +59,7 @@
 
/**
 * Create a voter on a direct request from a remote site.
-* @param $election SecurePoll_Election
+* @param SecurePoll_Election $election
 * @return Status
 */
function requestLogin( $election ) {
@@ -68,7 +69,7 @@
/**
 * Get the voter associated with the current session. Returns false if
 * there is no session.
-* @param $election SecurePoll_Election
+* @param SecurePoll_Election $election
 * @return SecurePoll_Election
 */
function getVoterFromSession( $election ) {
@@ -105,7 +106,7 @@
 * Get a voter object with the relevant parameters.
 * If no voter exists with those parameters, a new one is created. If 
one
 * does exist already, it is returned.
-* @param $params array
+* @param array $params
 * @return SecurePoll_Voter
 */
function getVoter( $params ) {
@@ -138,7 +139,7 @@
 
/**
 * Create a voter without user interaction, and create a sessi

[MediaWiki-commits] [Gerrit] mediawiki...SecurePoll[master]: Improve some parameter docs

2017-08-10 Thread Umherirrender (Code Review)
Umherirrender has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/371004 )

Change subject: Improve some parameter docs
..

Improve some parameter docs

Change-Id: Ifc9967f1e0470a86e56f9d883ed13c0e55125bf3
---
M composer.json
M includes/main/Context.php
M includes/main/Store.php
M includes/pages/ListPage.php
M includes/user/Auth.php
M phpcs.xml
6 files changed, 25 insertions(+), 24 deletions(-)


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

diff --git a/composer.json b/composer.json
index bf202bf..fd295f4 100644
--- a/composer.json
+++ b/composer.json
@@ -7,7 +7,7 @@
"scripts": {
"fix": "phpcbf",
"test": [
-   "parallel-lint . --exclude vendor",
+   "parallel-lint . --exclude vendor --exclude 
node_modules",
"phpcs -p -s"
]
}
diff --git a/includes/main/Context.php b/includes/main/Context.php
index 1bd6f08..ac14d06 100644
--- a/includes/main/Context.php
+++ b/includes/main/Context.php
@@ -248,7 +248,7 @@
/**
 * Get a database object, or throw an exception if the current store 
object
 * does not support database operations.
-* @param integer $index DB_MASTER or DB_REPLICA
+* @param int $index DB_MASTER or DB_REPLICA
 * @return DatabaseBase
 */
function getDB( $index = DB_MASTER ) {
diff --git a/includes/main/Store.php b/includes/main/Store.php
index 8f851cf..4934f47 100644
--- a/includes/main/Store.php
+++ b/includes/main/Store.php
@@ -35,8 +35,8 @@
 
/**
 * Get the type of one or more SecurePoll entities.
-* @param $ids Int
-* @return String
+* @param int $id
+* @return string
 */
function getEntityType( $id );
 
@@ -60,7 +60,7 @@
 
/**
 * Get a database connection object.
-* @param integer $index DB_MASTER or DB_REPLICA
+* @param int $index DB_MASTER or DB_REPLICA
 */
function getDB( $index = DB_MASTER );
 
diff --git a/includes/pages/ListPage.php b/includes/pages/ListPage.php
index 710670a..d3cbddc 100644
--- a/includes/pages/ListPage.php
+++ b/includes/pages/ListPage.php
@@ -10,7 +10,7 @@
 
/**
 * Execute the subpage.
-* @param $params array Array of subpage parameters.
+* @param array $params Array of subpage parameters.
 */
public function execute( $params ) {
$out = $this->specialPage->getOutput();
@@ -132,9 +132,9 @@
 
/**
 * The strike/unstrike backend.
-* @param $action string strike or unstrike
-* @param $voteId integer The vote ID
-* @param $reason string The reason
+* @param string $action strike or unstrike
+* @param int $voteId The vote ID
+* @param string $reason The reason
 */
public function strike( $action, $voteId, $reason ) {
$dbw = $this->context->getDB();
diff --git a/includes/user/Auth.php b/includes/user/Auth.php
index 92ea666..d9a5b53 100644
--- a/includes/user/Auth.php
+++ b/includes/user/Auth.php
@@ -19,6 +19,7 @@
 * Create an auth object of the given type
 * @param SecurePoll_Context $context
 * @param string $type
+* @return SecurePoll_LocalAuth|SecurePoll_RemoteMWAuth
 * @throws MWException
 */
static function factory( $context, $type ) {
@@ -49,7 +50,7 @@
/**
 * Create a voter transparently, without user interaction.
 * Sessions authorized against local accounts are created this way.
-* @param $election SecurePoll_Election
+* @param SecurePoll_Election $election
 * @return Status
 */
function autoLogin( $election ) {
@@ -58,7 +59,7 @@
 
/**
 * Create a voter on a direct request from a remote site.
-* @param $election SecurePoll_Election
+* @param SecurePoll_Election $election
 * @return Status
 */
function requestLogin( $election ) {
@@ -68,7 +69,7 @@
/**
 * Get the voter associated with the current session. Returns false if
 * there is no session.
-* @param $election SecurePoll_Election
+* @param SecurePoll_Election $election
 * @return SecurePoll_Election
 */
function getVoterFromSession( $election ) {
@@ -105,7 +106,7 @@
 * Get a voter object with the relevant parameters.
 * If no voter exists with those parameters, a new one is created. If 
one
 * does exist already, it is returned.
-* @param $params array
+* @param array $params
 * @return SecurePoll_Voter
 */
function getVoter( $params ) {
@@ -138,7 +139,7 @@
 
/**
 * Create a voter without user interaction,