Addshore has uploaded a new change for review.

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

Change subject: Use public instead of var in classes
......................................................................

Use public instead of var in classes

Change-Id: Ib32431d9d22593b44bc1589c1b9865e451057e6f
---
M cli/convertVotes.php
M cli/testDebian.php
M includes/ballots/Ballot.php
M includes/ballots/RadioRangeBallot.php
M includes/crypt/Crypt.php
M includes/crypt/Random.php
M includes/entities/Election.php
M includes/entities/Entity.php
M includes/entities/Question.php
M includes/main/Base.php
M includes/main/Context.php
M includes/main/Store.php
M includes/pages/DetailsPage.php
M includes/pages/DumpPage.php
M includes/pages/EntryPage.php
M includes/pages/ListPage.php
M includes/pages/Page.php
M includes/pages/VotePage.php
M includes/talliers/AlternativeVoteTallier.php
M includes/talliers/CommentDumper.php
M includes/talliers/HistogramRangeTallier.php
M includes/talliers/PairwiseTallier.php
M includes/talliers/PluralityTallier.php
M includes/talliers/RandomPrefVoteTallier.php
M includes/talliers/Tallier.php
M includes/user/Auth.php
M includes/user/Voter.php
27 files changed, 66 insertions(+), 66 deletions(-)


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

diff --git a/cli/convertVotes.php b/cli/convertVotes.php
index 3e77daf..bfcf7e6 100644
--- a/cli/convertVotes.php
+++ b/cli/convertVotes.php
@@ -33,7 +33,7 @@
 
 
 class SecurePoll_ConvertVotes {
-       var $context, $election;
+       public $context, $election;
 
        function convertFile( $fileName ) {
                $this->context = SecurePoll_Context::newFromXmlFile( $fileName 
);
diff --git a/cli/testDebian.php b/cli/testDebian.php
index 05e3bd7..5c5551a 100644
--- a/cli/testDebian.php
+++ b/cli/testDebian.php
@@ -138,7 +138,7 @@
 }
 
 class SecurePoll_FakeQuestion {
-       var $options;
+       public $options;
 
        function __construct( $options ) {
                $this->options = array();
@@ -153,7 +153,7 @@
 }
 
 class SecurePoll_FakeOption {
-       var $id, $name;
+       public $id, $name;
 
        function __construct( $id, $name ) {
                $this->id = $id;
diff --git a/includes/ballots/Ballot.php b/includes/ballots/Ballot.php
index 3d37d78..4f9a178 100644
--- a/includes/ballots/Ballot.php
+++ b/includes/ballots/Ballot.php
@@ -4,7 +4,7 @@
  * Parent class for ballot forms. This is the UI component of a voting method.
  */
 abstract class SecurePoll_Ballot {
-       var $election, $context;
+       public $election, $context;
 
        static $ballotTypes = array(
                'approval' => 'SecurePoll_ApprovalBallot',
@@ -263,8 +263,8 @@
 }
 
 class SecurePoll_BallotStatus extends Status {
-       var $sp_context;
-       var $sp_ids = array();
+       public $sp_context;
+       public $sp_ids = array();
 
        function __construct( $context ) {
                $this->sp_context = $context;
diff --git a/includes/ballots/RadioRangeBallot.php 
b/includes/ballots/RadioRangeBallot.php
index 3b67ac2..5e3524d 100644
--- a/includes/ballots/RadioRangeBallot.php
+++ b/includes/ballots/RadioRangeBallot.php
@@ -17,7 +17,7 @@
  *     column-1, column0, column+1, etc.
  */
 class SecurePoll_RadioRangeBallot extends SecurePoll_Ballot {
-       var $columnLabels, $minMax;
+       public $columnLabels, $minMax;
 
        static function getTallyTypes() {
                return array( 'plurality', 'histogram-range' );
diff --git a/includes/crypt/Crypt.php b/includes/crypt/Crypt.php
index ce1868c..cad201e 100644
--- a/includes/crypt/Crypt.php
+++ b/includes/crypt/Crypt.php
@@ -75,8 +75,8 @@
  * gpg-decrypt-key is for tallying.
  */
 class SecurePoll_GpgCrypt {
-       var $context, $election;
-       var $recipient, $signer, $homeDir;
+       public $context, $election;
+       public $recipient, $signer, $homeDir;
 
        static function getCreateDescriptors() {
                $ret = SecurePoll_Crypt::getCreateDescriptors();
diff --git a/includes/crypt/Random.php b/includes/crypt/Random.php
index de201d0..128d0fe 100644
--- a/includes/crypt/Random.php
+++ b/includes/crypt/Random.php
@@ -1,7 +1,7 @@
 <?php
 
 class SecurePoll_Random {
-       var $urandom;
+       public $urandom;
 
        /**
         * Open a /dev/urandom file handle
diff --git a/includes/entities/Election.php b/includes/entities/Election.php
index efad7f3..713d3c9 100644
--- a/includes/entities/Election.php
+++ b/includes/entities/Election.php
@@ -62,9 +62,9 @@
  *          return-url
  */
 class SecurePoll_Election extends SecurePoll_Entity {
-       var $questions, $auth, $ballot;
-       var $id, $title, $ballotType, $tallyType, $primaryLang;
-       var $startDate, $endDate, $authType;
+       public $questions, $auth, $ballot;
+       public $id, $title, $ballotType, $tallyType, $primaryLang;
+       public $startDate, $endDate, $authType;
 
        /**
         * Constructor.
diff --git a/includes/entities/Entity.php b/includes/entities/Entity.php
index 8a56047..51d97e4 100644
--- a/includes/entities/Entity.php
+++ b/includes/entities/Entity.php
@@ -11,11 +11,11 @@
  * properties, and a descendant tree which is used to accelerate message 
loading.
  */
 class SecurePoll_Entity {
-       var $id;
-       var $electionId;
-       var $context;
-       var $messagesLoaded = array();
-       var $properties;
+       public $id;
+       public $electionId;
+       public $context;
+       public $messagesLoaded = array();
+       public $properties;
 
        /**
         * Create an entity of the given type. This is typically called from the
diff --git a/includes/entities/Question.php b/includes/entities/Question.php
index 226d42f..e862dd5 100644
--- a/includes/entities/Question.php
+++ b/includes/entities/Question.php
@@ -5,7 +5,7 @@
  * more than one question in an election.
  */
 class SecurePoll_Question extends SecurePoll_Entity {
-       var $options, $electionId;
+       public $options, $electionId;
 
        /**
         * Constructor
diff --git a/includes/main/Base.php b/includes/main/Base.php
index eb97e03..6394833 100644
--- a/includes/main/Base.php
+++ b/includes/main/Base.php
@@ -20,7 +20,7 @@
                'votereligibility' => 'SecurePoll_VoterEligibilityPage',
        );
 
-       var $sp_context, $request;
+       public $sp_context, $request;
 
        /**
         * Constructor
diff --git a/includes/main/Context.php b/includes/main/Context.php
index df0a602..c59a7f0 100644
--- a/includes/main/Context.php
+++ b/includes/main/Context.php
@@ -20,30 +20,30 @@
        public $languages = array( 'en' );
 
        /** Message text cache */
-       var $messageCache = array();
+       public $messageCache = array();
 
        /** election cache */
-       var $electionCache = array();
+       public $electionCache = array();
 
        /**
         * Which messages are loaded. 2-d array: language and entity ID, value 
arbitrary.
         */
-       var $messagesLoaded = array();
+       public $messagesLoaded = array();
 
        /** ParserOptions instance used for message parsing */
-       var $parserOptions;
+       public $parserOptions;
 
        /** The store class, for lazy loading */
-       var $storeClass = 'SecurePoll_DBStore';
+       public $storeClass = 'SecurePoll_DBStore';
 
        /** The store object */
-       var $store;
+       public $store;
 
        /** The SecurePoll_Random instance */
-       var $random;
+       public $random;
 
        /** The Database instance */
-       var $db;
+       public $db;
 
        /**
         * Create a new SecurePoll_Context with an XML file as the storage 
backend.
diff --git a/includes/main/Store.php b/includes/main/Store.php
index 1a7cfe8..9782dbe 100644
--- a/includes/main/Store.php
+++ b/includes/main/Store.php
@@ -274,8 +274,8 @@
  * subclass.
  */
 class SecurePoll_MemoryStore implements SecurePoll_Store {
-       var $messages, $properties, $idsByName, $votes;
-       var $entityInfo;
+       public $messages, $properties, $idsByName, $votes;
+       public $entityInfo;
 
        /**
         * Get an array containing all election IDs stored in this object
@@ -367,8 +367,8 @@
  * and vote data can be loaded into a tallier on demand.
  */
 class SecurePoll_XMLStore extends SecurePoll_MemoryStore {
-       var $xmlReader, $fileName;
-       var $voteCallback, $voteElectionId, $voteCallbackStatus;
+       public $xmlReader, $fileName;
+       public $voteCallback, $voteElectionId, $voteCallbackStatus;
 
        /** Valid entity info keys by entity type. */
        static $entityInfoKeys = array(
diff --git a/includes/pages/DetailsPage.php b/includes/pages/DetailsPage.php
index b52bb93..bf5b049 100644
--- a/includes/pages/DetailsPage.php
+++ b/includes/pages/DetailsPage.php
@@ -150,7 +150,7 @@
  * Pager for the strike log. See TablePager documentation.
  */
 class SecurePoll_StrikePager extends TablePager {
-       var $detailsPage, $voteId;
+       public $detailsPage, $voteId;
 
        function __construct( $detailsPage, $voteId ) {
                $this->detailsPage = $detailsPage;
diff --git a/includes/pages/DumpPage.php b/includes/pages/DumpPage.php
index 5fbe700..17bdb25 100644
--- a/includes/pages/DumpPage.php
+++ b/includes/pages/DumpPage.php
@@ -4,7 +4,7 @@
  * Special:SecurePoll subpage for exporting encrypted election records.
  */
 class SecurePoll_DumpPage extends SecurePoll_Page {
-       var $headersSent;
+       public $headersSent;
 
        /**
         * Execute the subpage.
diff --git a/includes/pages/EntryPage.php b/includes/pages/EntryPage.php
index 93b287f..ef2f504 100644
--- a/includes/pages/EntryPage.php
+++ b/includes/pages/EntryPage.php
@@ -41,7 +41,7 @@
  * Pager for an election list. See TablePager documentation.
  */
 class SecurePoll_ElectionPager extends TablePager {
-       var $subpages = array(
+       public $subpages = array(
                'vote' => array(
                        'public' => true,
                        'visible-after-close' => false,
@@ -67,13 +67,13 @@
                        'visible-after-close' => true,
                ),
        );
-       var $fields = array(
+       public $fields = array(
                'el_title',
                'el_start_date',
                'el_end_date',
                'links'
        );
-       var $entryPage;
+       public $entryPage;
 
        function __construct( $parent ) {
                $this->entryPage = $parent;
diff --git a/includes/pages/ListPage.php b/includes/pages/ListPage.php
index d47acda..13df424 100644
--- a/includes/pages/ListPage.php
+++ b/includes/pages/ListPage.php
@@ -5,7 +5,7 @@
  * Provides an administrator interface for striking fraudulent votes.
  */
 class SecurePoll_ListPage extends SecurePoll_Page {
-       var $election;
+       public $election;
 
        /**
         * Execute the subpage.
@@ -172,7 +172,7 @@
  * is an admin.
  */
 class SecurePoll_ListPager extends TablePager {
-       var $listPage, $isAdmin, $election;
+       public $listPage, $isAdmin, $election;
 
        static $publicFields = array(
                'vote_timestamp',
diff --git a/includes/pages/Page.php b/includes/pages/Page.php
index 8e0a6d3..9743539 100644
--- a/includes/pages/Page.php
+++ b/includes/pages/Page.php
@@ -4,8 +4,8 @@
  * Parent class for Special:SecurePoll subpages.
  */
 abstract class SecurePoll_Page {
-       var $parent, $election, $auth, $user;
-       var $context;
+       public $parent, $election, $auth, $user;
+       public $context;
 
        /**
         * Constructor.
diff --git a/includes/pages/VotePage.php b/includes/pages/VotePage.php
index fdb6f2a..f0d9cda 100644
--- a/includes/pages/VotePage.php
+++ b/includes/pages/VotePage.php
@@ -4,8 +4,8 @@
  * The subpage for casting votes.
  */
 class SecurePoll_VotePage extends SecurePoll_Page {
-       var $languages;
-       var $election, $auth, $user;
+       public $languages;
+       public $election, $auth, $user;
 
        /**
         * Execute the subpage.
diff --git a/includes/talliers/AlternativeVoteTallier.php 
b/includes/talliers/AlternativeVoteTallier.php
index 41e5a31..543b4eb 100644
--- a/includes/talliers/AlternativeVoteTallier.php
+++ b/includes/talliers/AlternativeVoteTallier.php
@@ -9,27 +9,27 @@
         * Array of ballot bins for each candidate
         * @var array
         */
-       var $ballots = array();
+       public $ballots = array();
 
        /**
         * Votes which give the same preference to more than one candidate are 
considered
         * spoilt; keep a count of these so scrutineers can check that the 
numbers add up
         * array( <round number> => <number>
         */
-       var $spoilt = array( 1 => 0);
-       var $exhausted = array( 1 => 0 );
+       public $spoilt = array( 1 => 0);
+       public $exhausted = array( 1 => 0 );
 
        // Total number of counting rounds
-       var $rounds = 0;
+       public $rounds = 0;
 
        // Total number of candidates who received any votes at all
-       var $numCandidates = 0;
+       public $numCandidates = 0;
 
        /**
         * The results of the counting process
         * array( <option id> => array( <round number> => <votes> ) )
         */
-       var $results = array();
+       public $results = array();
 
 
        /**
diff --git a/includes/talliers/CommentDumper.php 
b/includes/talliers/CommentDumper.php
index bd4d20d..32484ae 100644
--- a/includes/talliers/CommentDumper.php
+++ b/includes/talliers/CommentDumper.php
@@ -4,8 +4,8 @@
  * A class that dumps the comments from an election
  */
 class SecurePoll_CommentDumper extends SecurePoll_ElectionTallier {
-       var $csvHandle;
-       var $skipEmptyComments;
+       public $csvHandle;
+       public $skipEmptyComments;
        private $countSoFar;
 
        public function __construct( $context, $election, $skipEmptyComments = 
true ) {
diff --git a/includes/talliers/HistogramRangeTallier.php 
b/includes/talliers/HistogramRangeTallier.php
index bd85a8c..3c11b06 100644
--- a/includes/talliers/HistogramRangeTallier.php
+++ b/includes/talliers/HistogramRangeTallier.php
@@ -1,11 +1,11 @@
 <?php
 
 class SecurePoll_HistogramRangeTallier extends SecurePoll_Tallier {
-       var $histogram = array();
-       var $sums = array();
-       var $counts = array();
-       var $averages;
-       var $minScore, $maxScore;
+       public $histogram = array();
+       public $sums = array();
+       public $counts = array();
+       public $averages;
+       public $minScore, $maxScore;
 
        function __construct( $context, $electionTallier, $question ) {
                parent::__construct( $context, $electionTallier, $question );
diff --git a/includes/talliers/PairwiseTallier.php 
b/includes/talliers/PairwiseTallier.php
index 93057fd..01466c3 100644
--- a/includes/talliers/PairwiseTallier.php
+++ b/includes/talliers/PairwiseTallier.php
@@ -5,10 +5,10 @@
  * Tested via SecurePoll_SchulzeTallier.
  */
 abstract class SecurePoll_PairwiseTallier extends SecurePoll_Tallier {
-       var $optionIds = array();
-       var $victories = array();
-       var $abbrevs;
-       var $rowLabels = array();
+       public $optionIds = array();
+       public $victories = array();
+       public $abbrevs;
+       public $rowLabels = array();
 
        function __construct( $context, $electionTallier, $question ) {
                parent::__construct( $context, $electionTallier, $question );
diff --git a/includes/talliers/PluralityTallier.php 
b/includes/talliers/PluralityTallier.php
index ac127be..8d9dd31 100644
--- a/includes/talliers/PluralityTallier.php
+++ b/includes/talliers/PluralityTallier.php
@@ -4,7 +4,7 @@
  * Tallier that supports choose-one, approval and range voting
  */
 class SecurePoll_PluralityTallier extends SecurePoll_Tallier {
-       var $tally = array();
+       public $tally = array();
 
        /**
         * @param  $context SecurePoll_Context
diff --git a/includes/talliers/RandomPrefVoteTallier.php 
b/includes/talliers/RandomPrefVoteTallier.php
index 80fc1fb..8b56f71 100644
--- a/includes/talliers/RandomPrefVoteTallier.php
+++ b/includes/talliers/RandomPrefVoteTallier.php
@@ -5,7 +5,7 @@
  * selecting random preferential votes. Untested.
  */
 abstract class SecurePoll_RandomPrefVoteTallier {
-       var $records, $random;
+       public $records, $random;
 
        function addVote( $vote ) {
                $this->records[] = $vote;
diff --git a/includes/talliers/Tallier.php b/includes/talliers/Tallier.php
index fa5ef76..5d97e9f 100644
--- a/includes/talliers/Tallier.php
+++ b/includes/talliers/Tallier.php
@@ -6,7 +6,7 @@
  * questions.
  */
 abstract class SecurePoll_Tallier {
-       var $context, $question, $electionTallier, $election, $optionsById;
+       public $context, $question, $electionTallier, $election, $optionsById;
 
        abstract function addVote( $scores );
        abstract function getHtmlResult();
diff --git a/includes/user/Auth.php b/includes/user/Auth.php
index 998d9e6..1a252ec 100644
--- a/includes/user/Auth.php
+++ b/includes/user/Auth.php
@@ -4,7 +4,7 @@
  * Class for handling guest logins and sessions. Creates SecurePoll_Voter 
objects.
  */
 class SecurePoll_Auth {
-       var $context;
+       public $context;
 
        /**
         * List of available authorization modules (subclasses)
diff --git a/includes/user/Voter.php b/includes/user/Voter.php
index 7d54343..9e9850a 100644
--- a/includes/user/Voter.php
+++ b/includes/user/Voter.php
@@ -5,8 +5,8 @@
  * properties include a snapshot of heuristic qualifications such as edit 
count.
  */
 class SecurePoll_Voter {
-       var $id, $electionId, $name, $domain, $wiki, $type, $url;
-       var $properties = array();
+       public $id, $electionId, $name, $domain, $wiki, $type, $url;
+       public $properties = array();
 
        static $paramNames = array( 'id', 'electionId', 'name', 'domain', 
'wiki', 'type', 'url', 'properties' );
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib32431d9d22593b44bc1589c1b9865e451057e6f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SecurePoll
Gerrit-Branch: master
Gerrit-Owner: Addshore <[email protected]>

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

Reply via email to