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 array $users
  * @return array
  */
 function spGetQualifiedUsers( $users ) {
@@ -120,8 +120,8 @@
 }
 
 /**
- * @param $db DatabaseBase
- * @param $userNames
+ * @param IDatabase $db
+ * @param string[] $userNames
  * @return array
  */
 function spGetEditCounts( $db, $userNames ) {
@@ -148,8 +148,8 @@
  * Short is 20 edits in a period between 15 December 2012 and 30 April 2013
  * Long is 300 edits before 15 April 2013
  *
- * @param $short
- * @param $long
+ * @param int $short
+ * @param int $long
  * @return bool
  */
 function spIsQualified( $short, $long ) {
diff --git a/cli/wm-scripts/bv2015/voterList.php 
b/cli/wm-scripts/bv2015/voterList.php
index 08e9b29..a772c51 100644
--- a/cli/wm-scripts/bv2015/voterList.php
+++ b/cli/wm-scripts/bv2015/voterList.php
@@ -48,7 +48,7 @@
 echo wfWikiID() . " qualified \t$numQualified\n";
 
 /**
- * @param $users array
+ * @param array $users
  * @return array
  */
 function spGetQualifiedUsers( $users ) {
@@ -94,8 +94,8 @@
 }
 
 /**
- * @param $db DatabaseBase
- * @param $userNames
+ * @param IDatabase $db
+ * @param string[] $userNames
  * @return array
  */
 function spGetEditCounts( $db, $userNames ) {
@@ -120,8 +120,8 @@
 /**
  * Returns whether a user "is qualified" to vote based on edit count
  *
- * @param $short
- * @param $long
+ * @param int $short
+ * @param int $long
  * @return bool
  */
 function spIsQualified( $short, $long ) {
@@ -130,6 +130,8 @@
 
 /**
  * Report progress
+ * @param int $current
+ * @param int $total
  */
 function spReportProgress( $current, $total ) {
        static $lastReportTime, $startTime;
diff --git a/cli/wm-scripts/bv2017/voterList.php 
b/cli/wm-scripts/bv2017/voterList.php
index 26ce53b..08b9a7f 100644
--- a/cli/wm-scripts/bv2017/voterList.php
+++ b/cli/wm-scripts/bv2017/voterList.php
@@ -48,7 +48,7 @@
 echo wfWikiID() . " qualified \t$numQualified\n";
 
 /**
- * @param $users array
+ * @param array $users
  * @return array
  */
 function spGetQualifiedUsers( $users ) {
@@ -94,8 +94,8 @@
 }
 
 /**
- * @param $db DatabaseBase
- * @param $userNames
+ * @param IDatabase $db
+ * @param string[] $userNames
  * @return array
  */
 function spGetEditCounts( $db, $userNames ) {
@@ -120,8 +120,8 @@
 /**
  * Returns whether a user "is qualified" to vote based on edit count
  *
- * @param $short
- * @param $long
+ * @param int $short
+ * @param int $long
  * @return bool
  */
 function spIsQualified( $short, $long ) {
@@ -130,6 +130,8 @@
 
 /**
  * Report progress
+ * @param int $current
+ * @param int $total
  */
 function spReportProgress( $current, $total ) {
        static $lastReportTime, $startTime;
diff --git a/includes/SecurePollHooks.php b/includes/SecurePollHooks.php
index 204aad0..0fb4f06 100644
--- a/includes/SecurePollHooks.php
+++ b/includes/SecurePollHooks.php
@@ -3,7 +3,7 @@
 class SecurePollHooks {
 
        /**
-        * @param $user User
+        * @param User $user
         * @return bool
         */
        public static function onUserLogout( $user ) {
@@ -12,7 +12,7 @@
        }
 
        /**
-        * @param $updater DatabaseUpdater
+        * @param DatabaseUpdater $updater
         * @return bool
         */
        public static function onLoadExtensionSchemaUpdates( $updater ) {
@@ -39,7 +39,7 @@
        }
 
        /**
-        * @param $namespaces array
+        * @param array &$namespaces
         */
        public static function onCanonicalNamespaces( &$namespaces ) {
                global $wgSecurePollUseNamespace;
@@ -50,12 +50,12 @@
        }
 
        /**
-        * @param $title Title
-        * @param $user User
-        * @param $action string
-        * @param $errors array
-        * @param $doExpensiveQueries bool
-        * @param $short
+        * @param Title $title
+        * @param User $user
+        * @param string $action
+        * @param array &$errors
+        * @param bool $doExpensiveQueries
+        * @param bool $short
         * @return bool
         */
        public static function onTitleQuickPermissions(
@@ -73,8 +73,8 @@
        }
 
        /**
-        * @param $title Title
-        * @param $model string
+        * @param Title $title
+        * @param string &$model
         * @return bool
         */
        public static function onContentHandlerDefaultModelFor( $title, &$model 
) {
diff --git a/includes/ballots/ApprovalBallot.php 
b/includes/ballots/ApprovalBallot.php
index e780d14..d77194f 100644
--- a/includes/ballots/ApprovalBallot.php
+++ b/includes/ballots/ApprovalBallot.php
@@ -9,8 +9,8 @@
        }
 
        /**
-        * @param $question SecurePoll_Question
-        * @param $options array
+        * @param SecurePoll_Question $question
+        * @param array $options
         * @return string
         */
        function getQuestionForm( $question, $options ) {
@@ -34,8 +34,8 @@
        }
 
        /**
-        * @param $question SecurePoll_Question
-        * @param $status Status
+        * @param SecurePoll_Question $question
+        * @param Status $status
         * @return string
         */
        function submitQuestion( $question, $status ) {
diff --git a/includes/ballots/Ballot.php b/includes/ballots/Ballot.php
index 4dab82b..ff82787 100644
--- a/includes/ballots/Ballot.php
+++ b/includes/ballots/Ballot.php
@@ -58,8 +58,8 @@
 
        /**
         * Get the HTML form segment for a single question
-        * @param $question SecurePoll_Question
-        * @param $options Array of options, in the order they should be 
displayed
+        * @param SecurePoll_Question $question
+        * @param array $options Array of options, in the order they should be 
displayed
         * @return string
         */
        abstract function getQuestionForm( $question, $options );
@@ -79,6 +79,7 @@
         * when successful, contains a voting record in the value member. To
         * preserve voter privacy, voting records should be the same length
         * regardless of voter choices.
+        * @return Status
         */
        function submitForm() {
                $questions = $this->election->getQuestions();
@@ -100,19 +101,24 @@
         * If there is a problem with the form data, the function should set a
         * fatal error in the $status object and return null.
         *
-        * @param $question
-        * @param $status
-        * @return string
+        * @param string $question
+        * @param Status $status
+        * @return string|null
         */
        abstract function submitQuestion( $question, $status );
 
        /**
         * Unpack a string record into an array format suitable for the tally 
type
+        * @param string $record
+        * @return array
         */
        abstract function unpackRecord( $record );
 
        /**
         * Convert a record to a string of some kind
+        * @param string $record
+        * @param array $options
+        * @return array
         */
        function convertRecord( $record, $options = [] ) {
                $scores = $this->unpackRecord( $record );
@@ -121,14 +127,17 @@
 
        /**
         * Convert a score array to a string of some kind
+        * @param array $scores
+        * @param array $options
+        * @return string
         */
        abstract function convertScores( $scores, $options = [] );
 
        /**
         * Create a ballot of the given type
-        * @param $context SecurePoll_Context
-        * @param $type string
-        * @param $election SecurePoll_Election
+        * @param SecurePoll_Context $context
+        * @param string $type
+        * @param SecurePoll_Election $election
         * @throws MWException
         * @return SecurePoll_Ballot
         */
@@ -142,8 +151,8 @@
 
        /**
         * Constructor.
-        * @param $context SecurePoll_Context
-        * @param $election SecurePoll_Election
+        * @param SecurePoll_Context $context
+        * @param SecurePoll_Election $election
         */
        function __construct( $context, $election ) {
                $this->context = $context;
@@ -153,6 +162,7 @@
        /**
         * Get the HTML for this ballot. <form> tags should not be included,
         * they will be added by the VotePage.
+        * @param bool|Status $prevStatus
         * @return string
         */
        function getForm( $prevStatus = false ) {
@@ -209,6 +219,8 @@
 
        /**
         * Convert a SecurePoll_BallotStatus object to HTML
+        * @param Status $status
+        * @return string
         */
        function formatStatus( $status ) {
                return $status->sp_getHTML( $this->usedErrorIds );
diff --git a/includes/ballots/ChooseBallot.php 
b/includes/ballots/ChooseBallot.php
index 04d62da..5d43cec 100644
--- a/includes/ballots/ChooseBallot.php
+++ b/includes/ballots/ChooseBallot.php
@@ -28,8 +28,8 @@
 
        /**
         * Get the HTML form segment for a single question
-        * @param $question SecurePoll_Question
-        * @param $options Array of options, in the order they should be 
displayed
+        * @param SecurePoll_Question $question
+        * @param array $options Array of options, in the order they should be 
displayed
         * @return string
         */
        function getQuestionForm( $question, $options ) {
@@ -50,8 +50,8 @@
        }
 
        /**
-        * @param $question SecurePoll_Question
-        * @param $status Status
+        * @param SecurePoll_Question $question
+        * @param Status $status
         * @return string
         */
        function submitQuestion( $question, $status ) {
diff --git a/includes/ballots/PreferentialBallot.php 
b/includes/ballots/PreferentialBallot.php
index 7222b0b..026ea33 100644
--- a/includes/ballots/PreferentialBallot.php
+++ b/includes/ballots/PreferentialBallot.php
@@ -26,7 +26,7 @@
        }
 
        /**
-        * @param $question SecurePoll_Question
+        * @param SecurePoll_Question $question
         * @param Array $options
         * @return string
         */
@@ -55,8 +55,8 @@
        }
 
        /**
-        * @param $question SecurePoll_Question
-        * @param $status Status
+        * @param SecurePoll_Question $question
+        * @param Status $status
         * @return string
         */
        function submitQuestion( $question, $status ) {
diff --git a/includes/ballots/RadioRangeBallot.php 
b/includes/ballots/RadioRangeBallot.php
index 840fd07..e413ee1 100644
--- a/includes/ballots/RadioRangeBallot.php
+++ b/includes/ballots/RadioRangeBallot.php
@@ -103,7 +103,7 @@
        }
 
        /**
-        * @param $question SecurePoll_Question
+        * @param SecurePoll_Question $question
         * @return array
         * @throws MWException
         */
@@ -117,7 +117,7 @@
        }
 
        /**
-        * @param $question SecurePoll_Question
+        * @param SecurePoll_Question $question
         * @return int
         * @throws MWException
         */
@@ -135,7 +135,7 @@
        }
 
        /**
-        * @param $question SecurePoll_Question
+        * @param SecurePoll_Question $question
         * @return array
         */
        function getScoresLeftToRight( $question ) {
@@ -152,7 +152,7 @@
        }
 
        /**
-        * @param $question SecurePoll_Question
+        * @param SecurePoll_Question $question
         * @return array
         */
        function getColumnLabels( $question ) {
@@ -200,8 +200,8 @@
        }
 
        /**
-        * @param $question SecurePoll_Question
-        * @param $options array
+        * @param SecurePoll_Question $question
+        * @param array $options
         * @return array
         */
        function getQuestionForm( $question, $options ) {
@@ -244,8 +244,8 @@
        }
 
        /**
-        * @param $question SecurePoll_Question
-        * @param $status Status
+        * @param SecurePoll_Question $question
+        * @param Status $status
         * @return array
         */
        function submitQuestion( $question, $status ) {
diff --git a/includes/ballots/RadioRangeCommentBallot.php 
b/includes/ballots/RadioRangeCommentBallot.php
index e9b3748..d3162dd 100644
--- a/includes/ballots/RadioRangeCommentBallot.php
+++ b/includes/ballots/RadioRangeCommentBallot.php
@@ -47,6 +47,8 @@
 
        /**
         * Copy and modify from parent function, complex to refactor.
+        * @param string $record
+        * @return bool
         */
        function unpackRecord( $record ) {
                $scores = [];
diff --git a/includes/crypt/Crypt.php b/includes/crypt/Crypt.php
index e166ccc..8534a3e 100644
--- a/includes/crypt/Crypt.php
+++ b/includes/crypt/Crypt.php
@@ -33,6 +33,10 @@
        /**
         * Create an encryption object of the given type. Currently only "gpg" 
is
         * implemented.
+        * @param SecurePoll_Context $context
+        * @param string $type
+        * @param SecurePoll_Election $election
+        * @return bool|SecurePoll_GpgCrypt
         */
        static function factory( $context, $type, $election ) {
                if ( !isset( self::$cryptTypes[$type] ) ) {
@@ -142,8 +146,8 @@
 
        /**
         * Constructor.
-        * @param $context
-        * @param $election SecurePoll_Election
+        * @param SecurePoll_Context $context
+        * @param SecurePoll_Election $election
         */
        function __construct( $context, $election ) {
                $this->context = $context;
@@ -216,7 +220,7 @@
 
        /**
         * Import a given exported key.
-        * @param $key string The full key data.
+        * @param string $key The full key data.
         * @return Status
         */
        function importKey( $key ) {
@@ -260,7 +264,7 @@
 
        /**
         * Shell out to GPG with the given additional command-line parameters
-        * @param $params string
+        * @param string $params
         * @return Status
         */
        protected function runGpg( $params ) {
@@ -323,7 +327,7 @@
        /**
         * Decrypt some data. When successful, the value member of the Status 
object
         * will contain the encrypted record.
-        * @param $encrypted string
+        * @param string $encrypted
         * @return Status
         */
        function decrypt( $encrypted ) {
diff --git a/includes/crypt/Random.php b/includes/crypt/Random.php
index 128d0fe..640ffd8 100644
--- a/includes/crypt/Random.php
+++ b/includes/crypt/Random.php
@@ -5,7 +5,7 @@
 
        /**
         * Open a /dev/urandom file handle
-        * Returns a Status object
+        * @return Status
         */
        function open() {
                if ( $this->urandom ) {
@@ -35,6 +35,8 @@
        /**
         * Get a random integer between 0 and ($maxp1 - 1).
         * Should only be called after open() succeeds.
+        * @param int $maxp1
+        * @return int
         */
        function getInt( $maxp1 ) {
                $numBytes = ceil( strlen( base_convert( $maxp1, 10, 16 ) ) / 2 
);
@@ -56,6 +58,8 @@
        /**
         * Works like shuffle() except more secure. Returns the new array 
instead
         * of modifying it. The algorithm is the Knuth/Durstenfeld kind.
+        * @param array $a
+        * @return array
         */
        function shuffle( $a ) {
                $a = array_values( $a );
diff --git a/includes/entities/Election.php b/includes/entities/Election.php
index c7e7555..cd5e9ee 100644
--- a/includes/entities/Election.php
+++ b/includes/entities/Election.php
@@ -79,7 +79,7 @@
         *
         * Do not use this constructor directly, instead use
         * SecurePoll_Context::getElection().
-        * @param $context SecurePoll_Context
+        * @param SecurePoll_Context $context
         * @param string $info
         */
        function __construct( $context, $info ) {
@@ -99,6 +99,7 @@
 
        /**
         * Get a list of localisable message names. See SecurePoll_Entity.
+        * @return array
         */
        function getMessageNames() {
                return [
@@ -112,6 +113,7 @@
 
        /**
         * Get the election's parent election... hmm...
+        * @return SecurePoll_Election
         */
        function getElection() {
                return $this;
@@ -119,6 +121,7 @@
 
        /**
         * Get a list of child entity objects. See SecurePoll_Entity.
+        * @return array
         */
        function getChildren() {
                return $this->getQuestions();
@@ -126,6 +129,7 @@
 
        /**
         * Get the start date in MW internal form.
+        * @return string
         */
        function getStartDate() {
                return $this->startDate;
@@ -133,6 +137,7 @@
 
        /**
         * Get the end date in MW internal form.
+        * @return string
         */
        function getEndDate() {
                return $this->endDate;
@@ -140,7 +145,7 @@
 
        /**
         * Returns true if the election has started.
-        * @param $ts string|bool The reference timestamp, or false for now.
+        * @param string|bool $ts The reference timestamp, or false for now.
         * @return bool
         */
        function isStarted( $ts = false ) {
@@ -152,7 +157,8 @@
 
        /**
         * Returns true if the election has finished.
-        * @param $ts string|bool The reference timestamp, or false for now.
+        * @param string|bool $ts The reference timestamp, or false for now.
+        * @return bool
         */
        function isFinished( $ts = false ) {
                if ( $ts === false ) {
@@ -175,7 +181,7 @@
        /**
         * Determine whether a voter would be qualified to vote in this 
election,
         * based on the given associative array of parameters.
-        * @param $params array Associative array
+        * @param array $params Associative array
         * @return Status
         */
        function getQualifiedStatus( $params ) {
@@ -274,7 +280,7 @@
 
        /**
         * Returns true if the user is an admin of the current election.
-        * @param $user User
+        * @param User $user
         * @return bool
         */
        function isAdmin( $user ) {
@@ -284,7 +290,8 @@
 
        /**
         * Returns true if the voter has voted already.
-        * @param $voter SecurePoll_Voter
+        * @param SecurePoll_Voter $voter
+        * @return bool
         */
        function hasVoted( $voter ) {
                $db = $this->context->getDB();
@@ -363,6 +370,7 @@
 
        /**
         * Get the tally type
+        * @return string
         */
        function getTallyType() {
                return $this->tallyType;
@@ -370,6 +378,8 @@
 
        /**
         * Call a callback function for each valid vote record, in random order.
+        * @param callable $callback
+        * @return Status
         */
        function dumpVotesToCallback( $callback ) {
                $random = $this->context->getRandom();
@@ -401,6 +411,8 @@
 
        /**
         * Get an XML snippet describing the configuration of this object
+        * @param array $params
+        * @return string
         */
        function getConfXml( $params = [] ) {
                $s = "<configuration>\n" .
@@ -438,6 +450,8 @@
 
        /**
         * Get property names which aren't included in an XML dump
+        * @param array $params
+        * @return array
         */
        function getPropertyDumpBlacklist( $params = [] ) {
                if ( !empty( $params['jump'] ) ) {
diff --git a/includes/entities/Entity.php b/includes/entities/Entity.php
index 34ed062..a39a309 100644
--- a/includes/entities/Entity.php
+++ b/includes/entities/Entity.php
@@ -20,9 +20,9 @@
        /**
         * Create an entity of the given type. This is typically called from the
         * child constructor.
-        * @param $context SecurePoll_Context
-        * @param $type string
-        * @param $info array Associative array of entity info
+        * @param SecurePoll_Context $context
+        * @param string $type
+        * @param array $info Associative array of entity info
         */
        function __construct( $context, $type, $info ) {
                $this->context = $context;
@@ -55,6 +55,7 @@
 
        /**
         * Get the entity ID.
+        * @return int
         */
        function getId() {
                return $this->id;
@@ -99,6 +100,7 @@
        /**
         * Load messages for a given language. It's not generally necessary to 
call
         * this since getMessage() does it automatically.
+        * @param string|false $lang
         */
        function loadMessages( $lang = false ) {
                if ( $lang === false ) {
@@ -130,8 +132,8 @@
         * Get a message, or false if the message does not exist. Does not use
         * the fallback sequence.
         *
-        * @param $name string
-        * @param $language string
+        * @param string $name
+        * @param string $language
         * @return bool
         */
        function getRawMessage( $name, $language ) {
@@ -146,7 +148,7 @@
         * If the message is not found even after looking at all possible 
languages,
         * a placeholder string is returned.
         *
-        * @param $name string
+        * @param string $name
         * @return bool|string
         */
        function getMessage( $name ) {
@@ -164,6 +166,9 @@
 
        /**
         * Get a message, and interpret it as wikitext, converting it to HTML.
+        * @param string $name
+        * @param bool $lineStart
+        * @return string
         */
        function parseMessage( $name, $lineStart = true ) {
                global $wgParser, $wgTitle;
@@ -180,6 +185,8 @@
 
        /**
         * Get a message and convert it from wikitext to HTML, without <p> tags.
+        * @param string $name
+        * @return string
         */
        function parseMessageInline( $name ) {
                return $this->parseMessage( $name, false );
@@ -188,6 +195,7 @@
        /**
         * Get a list of languages for which we have translations, for this 
entity
         * and its descendants.
+        * @return string
         */
        function getLangList() {
                $ids = [ $this->getId() ];
@@ -200,8 +208,8 @@
        /**
         * Get a property value. If it does not exist, the $default parameter
         * is passed back.
-        * @param $name string
-        * @param $default mixed
+        * @param string $name
+        * @param mixed $default
         * @return bool|mixed
         */
        function getProperty( $name, $default = false ) {
@@ -217,6 +225,7 @@
 
        /**
         * Get all defined properties as an associative array
+        * @return array
         */
        function getAllProperties() {
                if ( $this->properties === null ) {
@@ -227,6 +236,8 @@
 
        /**
         * Get configuration XML. Overridden by most subclasses.
+        * @param array $params
+        * @return string
         */
        function getConfXml( $params = [] ) {
                return "<{$this->type}>\n" .
@@ -236,6 +247,8 @@
 
        /**
         * Get an XML snippet giving the messages and properties
+        * @param array $params
+        * @return string
         */
        function getConfXmlEntityStuff( $params = [] ) {
                $s = Xml::element( 'id', [], $this->getId() ) . "\n";
@@ -268,6 +281,8 @@
        /**
         * Get property names which aren't included in an XML dump.
         * Overloaded by Election.
+        * @param array $params
+        * @return array
         */
        function getPropertyDumpBlacklist( $params = [] ) {
                return [];
diff --git a/includes/entities/Option.php b/includes/entities/Option.php
index 178fe31..166d5f6 100644
--- a/includes/entities/Option.php
+++ b/includes/entities/Option.php
@@ -7,8 +7,8 @@
 class SecurePoll_Option extends SecurePoll_Entity {
        /**
         * Constructor
-        * @param $context SecurePoll_Context
-        * @param $info array Associative array of entity info
+        * @param SecurePoll_Context $context
+        * @param array $info Associative array of entity info
         */
        function __construct( $context, $info ) {
                parent::__construct( $context, 'option', $info );
@@ -17,6 +17,7 @@
        /**
         * Get a list of localisable message names. This is used to provide the
         * translate subpage with a list of messages to localise.
+        * @return array
         */
        function getMessageNames() {
                return [ 'text' ];
diff --git a/includes/entities/Question.php b/includes/entities/Question.php
index 8d9f160..e6353dd 100644
--- a/includes/entities/Question.php
+++ b/includes/entities/Question.php
@@ -11,8 +11,8 @@
 
        /**
         * Constructor
-        * @param $context SecurePoll_Context
-        * @param $info array Associative array of entity info
+        * @param SecurePoll_Context $context
+        * @param array $info Associative array of entity info
         */
        function __construct( $context, $info ) {
                parent::__construct( $context, 'question', $info );
@@ -24,6 +24,7 @@
 
        /**
         * Get a list of localisable message names.
+        * @return array
         */
        function getMessageNames() {
                $ballot = $this->getElection()->getBallot();
@@ -32,6 +33,7 @@
 
        /**
         * Get the child entity objects.
+        * @return array
         */
        function getChildren() {
                return $this->options;
diff --git a/includes/main/Context.php b/includes/main/Context.php
index ac14d06..f8e617d 100644
--- a/includes/main/Context.php
+++ b/includes/main/Context.php
@@ -45,6 +45,8 @@
        /**
         * Create a new SecurePoll_Context with an XML file as the storage 
backend.
         * Returns false if there was a problem with the file, like a parse 
error.
+        * @param string $fileName
+        * @return false|self
         */
        static function newFromXmlFile( $fileName ) {
                $context = new self;
@@ -80,25 +82,39 @@
                return $this->store;
        }
 
-       /** Get a Title object for Special:SecurePoll */
+       /**
+        * Get a Title object for Special:SecurePoll
+        * @param string|false $subpage
+        * @return Title
+        */
        function getSpecialTitle( $subpage = false ) {
                return SpecialPage::getTitleFor( 'SecurePoll', $subpage );
        }
 
-       /** Set the store class */
+       /**
+        * Set the store class
+        * @param string $class
+        */
        function setStoreClass( $class ) {
                $this->store = null;
                $this->messageCache = $this->messagesLoaded = [];
                $this->storeClass = $class;
        }
 
-       /** Set the store object. Overrides any previous store class. */
+       /**
+        * Set the store object. Overrides any previous store class.
+        * @param SecurePoll_Store $store
+        */
        function setStore( $store ) {
                $this->messageCache = $this->messagesLoaded = [];
                $this->store = $store;
        }
 
-       /** Get the type of a particular entity **/
+       /**
+        * Get the type of a particular entity
+        * @param int $id
+        * @return string
+        */
        function getEntityType( $id ) {
                return $this->getStore()->getEntityType( $id );
        }
@@ -106,6 +122,7 @@
        /**
         * Get an election object from the store, with a given entity ID. 
Returns
         * false if it does not exist.
+        * @param int $id
         * @return SecurePoll_Election
         */
        function getElection( $id ) {
@@ -123,7 +140,8 @@
        /**
         * Get an election object from the store, with a given name. Returns 
false
         * if there is no such election.
-        * @return SecurePoll_Election
+        * @param string $name
+        * @return SecurePoll_Election|false
         */
        function getElectionByTitle( $name ) {
                $info = $this->getStore()->getElectionInfoByTitle( [ $name ] );
@@ -137,6 +155,7 @@
        /**
         * Get an election object from a securepoll_elections DB row. This will 
fail
         * if the current store class does not support database operations.
+        * @param stdClass $row
         * @return SecurePoll_Election
         */
        function newElectionFromRow( $row ) {
@@ -146,6 +165,8 @@
 
        /**
         * Get a voter object from a securepoll_voters row
+        * @param stdClass $row
+        * @return SecurePoll_Voter
         */
        function newVoterFromRow( $row ) {
                return SecurePoll_Voter::newFromRow( $this, $row );
@@ -157,6 +178,8 @@
         *
         * The row needs to be locked before this function is called, to avoid
         * duplicate key errors.
+        * @param array $params
+        * @return SecurePoll_Voter
         */
        function createVoter( $params ) {
                return SecurePoll_Voter::createVoter( $this, $params );
@@ -164,7 +187,7 @@
 
        /**
         * Create a voter object from the database
-        * @param $id
+        * @param string $id
         * @return SecurePoll_Voter or false if the ID is not valid
         */
        function getVoter( $id ) {
@@ -185,7 +208,7 @@
        /**
         * Set the global language fallback sequence.
         *
-        * @param $languages array A list of language codes. When a message is
+        * @param array $languages A list of language codes. When a message is
         *     requested, the first code in the array will be tried first, 
followed
         *     by the subsequent codes.
         */
@@ -198,8 +221,8 @@
         * This is an internal interface for SecurePoll_Entity, generally you
         * should use SecurePoll_Entity::getMessage() instead.
         *
-        * @param $lang string Language code
-        * @param $ids array Entity IDs
+        * @param string $lang Language code
+        * @param array $ids Entity IDs
         * @return array
         */
        function getMessages( $lang, $ids ) {
@@ -229,9 +252,9 @@
         * This is an internal interface for SecurePoll_Entity, generally you
         * should use SecurePoll_Entity::getMessage() instead.
         *
-        * @param $lang string Language code
-        * @param $id string|int Entity ID
-        * @param $key string Message key
+        * @param string $lang Language code
+        * @param string|int $id Entity ID
+        * @param string $key Message key
         * @return bool
         */
        function getMessage( $lang, $id, $key ) {
@@ -256,7 +279,7 @@
        }
 
        /**
-        * @param $info
+        * @param array $info
         * @return SecurePoll_Election
         */
        function newElection( $info ) {
@@ -264,7 +287,7 @@
        }
 
        /**
-        * @param $info
+        * @param array $info
         * @return SecurePoll_Question
         */
        function newQuestion( $info ) {
@@ -272,7 +295,7 @@
        }
 
        /**
-        * @param $info
+        * @param array $info
         * @return SecurePoll_Option
         */
        function newOption( $info ) {
@@ -280,8 +303,8 @@
        }
 
        /**
-        * @param $type
-        * @param $election
+        * @param string $type
+        * @param SecurePoll_Election $election
         * @return bool|SecurePoll_GpgCrypt
         */
        function newCrypt( $type, $election ) {
@@ -289,9 +312,9 @@
        }
 
        /**
-        * @param $type
-        * @param $electionTallier
-        * @param $question
+        * @param string $type
+        * @param SecurePoll_ElectionTallier $electionTallier
+        * @param SecurePoll_Question $question
         * @return SecurePoll_Tallier
         */
        function newTallier( $type, $electionTallier, $question ) {
@@ -299,8 +322,8 @@
        }
 
        /**
-        * @param $type
-        * @param $election
+        * @param string $type
+        * @param SecurePoll_Election $election
         * @return SecurePoll_Ballot
         */
        function newBallot( $type, $election ) {
@@ -308,7 +331,7 @@
        }
 
        /**
-        * @param $type
+        * @param string $type
         * @return SecurePoll_Auth
         */
        function newAuth( $type ) {
@@ -316,7 +339,7 @@
        }
 
        /**
-        * @param $params
+        * @param array $params
         * @return SecurePoll_Voter
         */
        function newVoter( $params ) {
@@ -324,7 +347,7 @@
        }
 
        /**
-        * @param $election
+        * @param SecurePoll_Election $election
         * @return SecurePoll_ElectionTallier
         */
        function newElectionTallier( $election ) {
@@ -335,9 +358,9 @@
         * Debugging function to output a representation of a mixed-type 
variable,
         * but omitting the $obj->context member variables for brevity.
         *
-        * @param $var mixed
-        * @param $return bool True to return the text instead of echoing
-        * @param $level int Recursion level, leave this as zero when calling.
+        * @param mixed $var
+        * @param bool $return True to return the text instead of echoing
+        * @param int $level Recursion level, leave this as zero when calling.
         * @return mixed|string
         */
        function varDump( $var, $return = false, $level = 0 ) {
@@ -376,7 +399,7 @@
        }
 
        /**
-        * @param $resource
+        * @param string $resource
         * @return string
         */
        function getResourceUrl( $resource ) {
diff --git a/includes/main/SpecialSecurePoll.php 
b/includes/main/SpecialSecurePoll.php
index 4b13c59..f74f9d4 100644
--- a/includes/main/SpecialSecurePoll.php
+++ b/includes/main/SpecialSecurePoll.php
@@ -38,7 +38,7 @@
        /**
         * Show the special page
         *
-        * @param $paramString Mixed: parameter passed to the page or null
+        * @param string|null $paramString parameter passed to the page or null
         */
        public function execute( $paramString ) {
                global $wgExtensionAssetsPath;
@@ -74,6 +74,8 @@
 
        /**
         * Get a SecurePoll_ActionPage subclass object for the given subpage 
name
+        * @param string $name
+        * @return false|SecurePoll_ActionPage
         */
        public function getSubpage( $name ) {
                if ( !isset( self::$pages[$name] ) ) {
@@ -86,6 +88,7 @@
 
        /**
         * Get a random token for CSRF protection
+        * @return string
         */
        public function getEditToken() {
                if ( !isset( $_SESSION['spToken'] ) ) {
diff --git a/includes/main/Store.php b/includes/main/Store.php
index 4a6ef07..52bb7c7 100644
--- a/includes/main/Store.php
+++ b/includes/main/Store.php
@@ -18,18 +18,22 @@
         * Get an array of messages with a given language, and entity IDs
         * in a given array of IDs. The return format is a 2-d array mapping ID
         * and message key to value.
+        * @param string $lang
+        * @param int[] $ids
         */
        function getMessages( $lang, $ids );
 
        /**
         * Get a list of languages that the given entity IDs have messages for.
         * Returns an array of language codes.
+        * @param int[] $ids
         */
        function getLangList( $ids );
 
        /**
         * Get an array of properties for a given set of IDs. Returns a 2-d 
array
         * mapping IDs and property keys to values.
+        * @param int[] $ids
         */
        function getProperties( $ids );
 
@@ -44,17 +48,20 @@
         * Get information about a set of elections, specifically the data that
         * is stored in the securepoll_elections row in the DB. Returns a 2-d
         * array mapping ID to associative array of properties.
+        * @param int[] $ids
         */
        function getElectionInfo( $ids );
 
        /**
         * Get election information for a given set of names.
+        * @param array $names
         */
        function getElectionInfoByTitle( $names );
 
        /**
         * Convert a row from the securepoll_elections table into an associative
         * array suitable for return by getElectionInfo().
+        * @param stdClass $row
         */
        function decodeElectionRow( $row );
 
@@ -67,11 +74,14 @@
        /**
         * Get an associative array of information about all questions in a 
given
         * election.
+        * @param int $electionId
         */
        function getQuestionInfo( $electionId );
 
        /**
         * Call a callback function for all valid votes with a given election 
ID.
+        * @param int $electionId
+        * @param callable $callback
         */
        function callbackValidVotes( $electionId, $callback );
 }
@@ -280,6 +290,7 @@
 
        /**
         * Get an array containing all election IDs stored in this object
+        * @return array
         */
        function getAllElectionIds() {
                $electionIds = [];
@@ -401,6 +412,7 @@
         * Constructor. Note that readFile() must be called before any 
information
         * can be accessed. SecurePoll_Context::newFromXmlFile() is a shortcut
         * method for this.
+        * @param string $fileName
         */
        function __construct( $fileName ) {
                $this->fileName = $fileName;
@@ -408,6 +420,7 @@
 
        /**
         * Read the file and return boolean success.
+        * @return bool
         */
        function readFile() {
                $this->xmlReader = new XMLReader;
@@ -424,6 +437,7 @@
 
        /**
         * Do the top-level document element, and return success.
+        * @return bool
         */
        function doTopLevel() {
                $xr = $this->xmlReader;
@@ -454,6 +468,7 @@
        /**
         * Read an <election> element and position the cursor past the end of 
it.
         * Return success.
+        * @return bool
         */
        function doElection() {
                $xr = $this->xmlReader;
@@ -512,6 +527,8 @@
         *
         * This function operates recursively to read child elements. It returns
         * the info array for the entity.
+        * @param string $entityType
+        * @return false|array
         */
        function readEntity( $entityType ) {
                $xr = $this->xmlReader;
@@ -604,6 +621,9 @@
 
        /**
         * Propagate parent ids to child elements
+        * @param array &$info
+        * @param string $key
+        * @param int $id
         */
        public function addParentIds( &$info, $key, $id ) {
                foreach ( self::$childTypes[$info['type']] as $childType ) {
@@ -621,6 +641,7 @@
         * When the cursor is positioned on an element node, this reads the 
entire
         * element and returns the contents as a string. On return, the cursor 
is
         * positioned past the end of the element.
+        * @return string
         */
        function readStringElement() {
                $xr = $this->xmlReader;
diff --git a/includes/pages/ActionPage.php b/includes/pages/ActionPage.php
index a7227dd..138104b 100644
--- a/includes/pages/ActionPage.php
+++ b/includes/pages/ActionPage.php
@@ -17,7 +17,7 @@
 
        /**
         * Constructor.
-        * @param $specialPage SecurePoll_SpecialSecurePoll
+        * @param SecurePoll_SpecialSecurePoll $specialPage
         */
        public function __construct( $specialPage ) {
                $this->specialPage = $specialPage;
@@ -26,13 +26,15 @@
 
        /**
         * Execute the subpage.
-        * @param $params array Array of subpage parameters.
+        * @param array $params Array of subpage parameters.
         */
        abstract public function execute( $params );
 
        /**
         * Internal utility function for initializing the global entity language
         * fallback sequence.
+        * @param User $user
+        * @param SecurePoll_Election $election
         */
        public function initLanguage( $user, $election ) {
                $uselang = $this->specialPage->getRequest()->getVal( 'uselang' 
);
@@ -59,6 +61,7 @@
 
        /**
         * Relay for SpecialPage::msg
+        * @return string
         */
        protected function msg( /* args */ ) {
                return call_user_func_array( [ $this->specialPage, 'msg' ], 
func_get_args() );
diff --git a/includes/pages/CreatePage.php b/includes/pages/CreatePage.php
index 2e44e02..1f12a83 100644
--- a/includes/pages/CreatePage.php
+++ b/includes/pages/CreatePage.php
@@ -6,7 +6,7 @@
 class SecurePoll_CreatePage extends SecurePoll_ActionPage {
        /**
         * Execute the subpage.
-        * @param $params array Array of subpage parameters.
+        * @param array $params Array of subpage parameters.
         * @throws MWException
         * @throws PermissionsError
         */
diff --git a/includes/pages/DetailsPage.php b/includes/pages/DetailsPage.php
index 04bfd76..53f391d 100644
--- a/includes/pages/DetailsPage.php
+++ b/includes/pages/DetailsPage.php
@@ -6,7 +6,7 @@
 class SecurePoll_DetailsPage extends SecurePoll_ActionPage {
        /**
         * Execute the subpage.
-        * @param $params array Array of subpage parameters.
+        * @param array $params Array of subpage parameters.
         */
        public function execute( $params ) {
                global $wgSecurePollKeepPrivateInfoDays;
@@ -135,8 +135,8 @@
 
        /**
         * Get a table row with a given header message and value
-        * @param $header string
-        * @param $value string
+        * @param string $header
+        * @param string $value
         * @return string
         */
        public function detailEntry( $header, $value ) {
diff --git a/includes/pages/DumpPage.php b/includes/pages/DumpPage.php
index ef7ed6f..a85707c 100644
--- a/includes/pages/DumpPage.php
+++ b/includes/pages/DumpPage.php
@@ -8,7 +8,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();
diff --git a/includes/pages/EntryPage.php b/includes/pages/EntryPage.php
index aecb060..59e7241 100644
--- a/includes/pages/EntryPage.php
+++ b/includes/pages/EntryPage.php
@@ -6,7 +6,7 @@
 class SecurePoll_EntryPage extends SecurePoll_ActionPage {
        /**
         * Execute the subpage.
-        * @param $params array Array of subpage parameters.
+        * @param array $params Array of subpage parameters.
         */
        function execute( $params ) {
                $pager = new SecurePoll_ElectionPager( $this );
@@ -112,7 +112,7 @@
 
        /**
         * Add classes based on whether the poll is open or closed
-        * @param $row database object
+        * @param stdClass $row database object
         * @return String
         * @see TablePager::getRowClass()
         */
diff --git a/includes/pages/ListPage.php b/includes/pages/ListPage.php
index d3cbddc..9b1c490 100644
--- a/includes/pages/ListPage.php
+++ b/includes/pages/ListPage.php
@@ -135,6 +135,7 @@
         * @param string $action strike or unstrike
         * @param int $voteId The vote ID
         * @param string $reason The reason
+        * @return Status
         */
        public function strike( $action, $voteId, $reason ) {
                $dbw = $this->context->getDB();
diff --git a/includes/pages/TallyPage.php b/includes/pages/TallyPage.php
index a27a8c6..72084d1 100644
--- a/includes/pages/TallyPage.php
+++ b/includes/pages/TallyPage.php
@@ -6,7 +6,7 @@
 class SecurePoll_TallyPage extends SecurePoll_ActionPage {
        /**
         * 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();
diff --git a/includes/pages/TranslatePage.php b/includes/pages/TranslatePage.php
index 7686dee..5fe91b3 100644
--- a/includes/pages/TranslatePage.php
+++ b/includes/pages/TranslatePage.php
@@ -6,7 +6,7 @@
 class SecurePoll_TranslatePage extends SecurePoll_ActionPage {
        /**
         * Execute the subpage.
-        * @param $params array Array of subpage parameters.
+        * @param array $params Array of subpage parameters.
         */
        public function execute( $params ) {
                global $wgSecurePollUseNamespace;
@@ -142,6 +142,7 @@
        }
 
        /**
+        * @param string|false $lang
         * @return Title
         */
        public function getTitle( $lang = false ) {
@@ -155,6 +156,7 @@
        /**
         * Show a language selector to allow the user to choose the language to
         * translate.
+        * @param string $selectedCode
         */
        public function showLanguageSelector( $selectedCode ) {
                $s =
@@ -181,6 +183,7 @@
 
        /**
         * Submit message text changes.
+        * @param string $secondary
         */
        public function doSubmit( $secondary ) {
                global $wgSecurePollUseNamespace;
diff --git a/includes/pages/VotePage.php b/includes/pages/VotePage.php
index 02066cb..74497a9 100644
--- a/includes/pages/VotePage.php
+++ b/includes/pages/VotePage.php
@@ -9,7 +9,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();
@@ -102,6 +102,7 @@
 
        /**
         * Show the voting form.
+        * @param Status|false $status
         */
        public function showForm( $status = false ) {
                $out = $this->specialPage->getOutput();
@@ -144,7 +145,7 @@
 
        /**
         * Add a vote to the database with the given unencrypted answer record.
-        * @param $record string
+        * @param string $record
         */
        public function logVote( $record ) {
                $out = $this->specialPage->getOutput();
diff --git a/includes/pages/VoterEligibilityPage.php 
b/includes/pages/VoterEligibilityPage.php
index bb485b5..89477de 100644
--- a/includes/pages/VoterEligibilityPage.php
+++ b/includes/pages/VoterEligibilityPage.php
@@ -12,7 +12,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();
diff --git a/includes/talliers/CommentDumper.php 
b/includes/talliers/CommentDumper.php
index 6c3f02c..e1d0029 100644
--- a/includes/talliers/CommentDumper.php
+++ b/includes/talliers/CommentDumper.php
@@ -24,8 +24,8 @@
         * On error, the Status object returned here will be passed through 
back to
         * the caller of callbackValidVotes().
         *
-        * @param $store SecurePoll_Store
-        * @param $record string Encrypted, packed record.
+        * @param SecurePoll_Store $store
+        * @param string $record Encrypted, packed record.
         * @return Status
         */
        function addRecord( $store, $record ) {
@@ -73,6 +73,7 @@
        /**
         * Get text formatted results for this tally. Should only be called 
after
         * execute().
+        * @return string
         */
        function getTextResult() {
                return stream_get_contents( $this->csvHandle, -1, 0 );
diff --git a/includes/talliers/ElectionTallier.php 
b/includes/talliers/ElectionTallier.php
index ab18e6d..7255872 100644
--- a/includes/talliers/ElectionTallier.php
+++ b/includes/talliers/ElectionTallier.php
@@ -11,8 +11,8 @@
 class SecurePoll_ElectionTallier {
        /**
         * Constructor.
-        * @param $context SecurePoll_Context
-        * @param $election SecurePoll_Election
+        * @param SecurePoll_Context $context
+        * @param SecurePoll_Election $election
         */
        function __construct( $context, $election ) {
                $this->context = $context;
@@ -23,6 +23,7 @@
         * Do the tally. Returns a Status object. On success, the value property
         * of the status will be an array of SecurePoll_Tallier objects, which 
can
         * be queried for results information.
+        * @return Status
         */
        function execute() {
                $store = $this->context->getStore();
@@ -55,8 +56,8 @@
         * On error, the Status object returned here will be passed through 
back to
         * the caller of callbackValidVotes().
         *
-        * @param $store SecurePoll_Store
-        * @param $record string Encrypted, packed record.
+        * @param SecurePoll_Store $store
+        * @param string $record Encrypted, packed record.
         * @return Status
         */
        function addRecord( $store, $record ) {
@@ -87,6 +88,7 @@
        /**
         * Get HTML formatted results for this tally. Should only be called 
after
         * execute().
+        * @return string
         */
        function getHtmlResult() {
                $s = '';
@@ -103,6 +105,7 @@
        /**
         * Get text formatted results for this tally. Should only be called 
after
         * execute().
+        * @return string
         */
        function getTextResult() {
                $s = '';
diff --git a/includes/talliers/PluralityTallier.php 
b/includes/talliers/PluralityTallier.php
index e90bfe6..94e1991 100644
--- a/includes/talliers/PluralityTallier.php
+++ b/includes/talliers/PluralityTallier.php
@@ -7,9 +7,9 @@
        public $tally = [];
 
        /**
-        * @param  $context SecurePoll_Context
-        * @param  $electionTallier SecurePoll_ElectionTallier
-        * @param  $question SecurePoll_Question
+        * @param SecurePoll_Context $context
+        * @param SecurePoll_ElectionTallier $electionTallier
+        * @param SecurePoll_Question $question
         */
        function __construct( $context, $electionTallier, $question ) {
                parent::__construct( $context, $electionTallier, $question );
diff --git a/includes/talliers/SchulzeTallier.php 
b/includes/talliers/SchulzeTallier.php
index 07e40b5..28c96ab 100644
--- a/includes/talliers/SchulzeTallier.php
+++ b/includes/talliers/SchulzeTallier.php
@@ -9,7 +9,7 @@
 class SecurePoll_SchulzeTallier extends SecurePoll_PairwiseTallier {
 
        /**
-        * @param $victories
+        * @param array $victories
         * @return array
         */
        function getPathStrengths( $victories ) {
@@ -115,6 +115,9 @@
         *
         * The inequality in the second part is reversed because the first part
         * refers to wins, and the second part refers to losses.
+        * @param array $s1
+        * @param array $s2
+        * @return bool
         */
        function isSchulzeWin( $s1, $s2 ) {
                return $s1[0] > $s2[0] || ( $s1[0] == $s2[0] && $s1[1] < $s2[1] 
);
diff --git a/includes/talliers/Tallier.php b/includes/talliers/Tallier.php
index e046896..cf20463 100644
--- a/includes/talliers/Tallier.php
+++ b/includes/talliers/Tallier.php
@@ -21,10 +21,10 @@
        ];
 
        /**
-        * @param $context
-        * @param $type
-        * @param $electionTallier
-        * @param $question
+        * @param SecurePoll_Context $context
+        * @param string $type
+        * @param SecurePoll_ElectionTallier $electionTallier
+        * @param SecurePoll_Question $question
         * @return SecurePoll_Tallier
         * @throws MWException
         */
@@ -57,9 +57,9 @@
        }
 
        /**
-        * @param  $context SecurePoll_Context
-        * @param  $electionTallier SecurePoll_ElectionTallier
-        * @param  $question SecurePoll_Question
+        * @param SecurePoll_Context $context
+        * @param SecurePoll_ElectionTallier $electionTallier
+        * @param SecurePoll_Question $question
         */
        function __construct( $context, $electionTallier, $question ) {
                $this->context = $context;
@@ -72,7 +72,7 @@
        }
 
        /**
-        * @param $ranks
+        * @param array $ranks
         * @return string
         */
        function convertRanksToHtml( $ranks ) {
@@ -99,7 +99,7 @@
        }
 
        /**
-        * @param $ranks
+        * @param array $ranks
         * @return string
         */
        function convertRanksToText( $ranks ) {
diff --git a/includes/user/Voter.php b/includes/user/Voter.php
index 26a099b..182254a 100644
--- a/includes/user/Voter.php
+++ b/includes/user/Voter.php
@@ -14,6 +14,8 @@
 
        /**
         * Create a voter from the given associative array of parameters
+        * @param SecurePoll_Context $context
+        * @param array $params
         */
        function __construct( $context, $params ) {
                $this->context = $context;
@@ -26,6 +28,8 @@
 
        /**
         * Create a voter object from the database
+        * @param SecurePoll_Context $context
+        * @param int $id
         * @return SecurePoll_Voter or false if the ID is not valid
         */
        static function newFromId( $context, $id ) {
@@ -39,6 +43,9 @@
 
        /**
         * Create a voter from a DB result row
+        * @param SecurePoll_Context $context
+        * @param stdClass $row
+        * @return self
         */
        static function newFromRow( $context, $row ) {
                return new self( $context, [
@@ -58,6 +65,9 @@
         *
         * The row needs to be locked before this function is called, to avoid
         * duplicate key errors.
+        * @param SecurePoll_Context $context
+        * @param array $params
+        * @return self
         */
        static function createVoter( $context, $params ) {
                $db = $context->getDB();
@@ -76,7 +86,10 @@
                return new self( $context, $params );
        }
 
-       /** Get the voter ID */
+       /**
+        * Get the voter ID
+        * @return int
+        */
        function getId() {
                return $this->id;
        }
@@ -84,6 +97,7 @@
        /**
         * Get the voter name. This is a short, ambiguous name appropriate for
         * display.
+        * @return string
         */
        function getName() {
                return $this->name;
@@ -91,6 +105,7 @@
 
        /**
         * Get the authorization type.
+        * @return string
         */
        function getType() {
                return $this->type;
@@ -99,6 +114,7 @@
        /**
         * Get the voter domain. The name and domain, taken together, should 
usually be
         * unique, although this is not strictly necessary.
+        * @return string
         */
        function getDomain() {
                return $this->domain;
@@ -106,6 +122,7 @@
 
        /**
         * Get a URL uniquely identifying the underlying user.
+        * @return string
         */
        function getUrl() {
                return $this->url;
@@ -113,6 +130,7 @@
 
        /**
         * Get the associated election ID
+        * @return int
         */
        function getElectionId() {
                return $this->electionId;
@@ -120,6 +138,7 @@
 
        /**
         * Get the voter's preferred language
+        * @return mixed
         */
        function getLanguage() {
                return $this->getProperty( 'language', 'en' );
@@ -127,6 +146,9 @@
 
        /**
         * Get a property from the property blob
+        * @param string $name
+        * @param string|false $default
+        * @return mixed
         */
        function getProperty( $name, $default = false ) {
                if ( isset( $this->properties[$name] ) ) {
@@ -138,6 +160,7 @@
 
        /**
         * Returns true if the voter is a guest user.
+        * @return bool
         */
        function isRemote() {
                return $this->type !== 'local';
@@ -145,6 +168,8 @@
 
        /**
         * Decode the properties blob to produce an associative array.
+        * @param string $blob
+        * @return array
         */
        static function decodeProperties( $blob ) {
                if ( strval( $blob ) == '' ) {
@@ -157,6 +182,8 @@
        /**
         * Encode an associative array of properties to a blob suitable for 
storing
         * in the database.
+        * @param array $props
+        * @return string
         */
        static function encodeProperties( $props ) {
                return serialize( $props );
@@ -179,6 +206,7 @@
 
        /**
         * Flag a duplicate voter
+        * @param int $voterId
         */
        function addCookieDup( $voterId ) {
                $dbw = $this->context->getDB();
diff --git a/phpcs.xml b/phpcs.xml
index 6b7d402..d4ef4b3 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -4,9 +4,6 @@
                <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected" />
                <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic" />
                <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingParamComment" />
-               <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingParamName" />
-               <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingParamTag" />
-               <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingReturn" />
                <exclude name="MediaWiki.Commenting.FunctionComment.WrongStyle" 
/>
                <exclude name="MediaWiki.Files.ClassMatchesFilename.NotMatch" />
                <exclude name="MediaWiki.Files.ClassMatchesFilename.WrongCase" 
/>

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifedd1d93be65d8f6aac6605f986f1b5787aac789
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SecurePoll
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <umherirrender_de...@web.de>
Gerrit-Reviewer: Huji <huji.h...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to