r81235 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81234‎ | r81235 | r81236 >
Date:06:13, 31 January 2011
Author:tstarling
Status:ok
Tags:
Comment:
SecurePoll: fixes for r64483:
* Fixed return type confusion in getElection(). Fixed the doc comment on Entity::getElection(), and fixed the return value in Election::getElection(). This makes it match the caller usage in e.g. Question::getMessageNames().
* Fixed incorrect use of array_key_exists(), it has two arguments.
* Fixed a few whitespace issues.
Modified paths:
  • /trunk/extensions/SecurePoll/includes/entities/Election.php (modified) (history)
  • /trunk/extensions/SecurePoll/includes/entities/Entity.php (modified) (history)
  • /trunk/extensions/SecurePoll/includes/main/Context.php (modified) (history)
  • /trunk/extensions/SecurePoll/includes/main/Store.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SecurePoll/includes/entities/Entity.php
@@ -62,7 +62,7 @@
6363
6464 /**
6565 * Get the parent election
66 - * @return Int
 66+ * @return SecurePoll_Election
6767 */
6868 public function getElection() {
6969 return $this->electionId !== null
Index: trunk/extensions/SecurePoll/includes/entities/Election.php
@@ -93,7 +93,7 @@
9494 * Get the election's parent election... hmm...
9595 */
9696 function getElection() {
97 - return $this->id;
 97+ return $this;
9898 }
9999
100100 /**
Index: trunk/extensions/SecurePoll/includes/main/Store.php
@@ -229,7 +229,7 @@
230230 return $questions;
231231 }
232232
233 - function callbackValidVotes( $electionId, $callback, $voterId=null ) {
 233+ function callbackValidVotes( $electionId, $callback, $voterId = null ) {
234234 $dbr = $this->getDB();
235235 $where = array(
236236 'vote_election' => $electionId,
@@ -356,7 +356,7 @@
357357 }
358358
359359 function getEntityType( $id ){
360 - return array_key_exists( $this->entityInfo[$id] )
 360+ return isset( $this->entityInfo[$id] )
361361 ? $this->entityInfo[$id]['type']
362362 : false;
363363 }
Index: trunk/extensions/SecurePoll/includes/main/Context.php
@@ -96,7 +96,7 @@
9797 }
9898
9999 /** Get the type of a particular entity **/
100 - function getEntityType( $id ){
 100+ function getEntityType( $id ) {
101101 return $this->getStore()->getEntityType( $id );
102102 }
103103
@@ -105,7 +105,7 @@
106106 * false if it does not exist.
107107 */
108108 function getElection( $id ) {
109 - if( !isset( $this->electionCache[$id] ) ){
 109+ if( !isset( $this->electionCache[$id] ) ) {
110110 $info = $this->getStore()->getElectionInfo( array( $id ) );
111111 if ( $info ) {
112112 $this->electionCache[$id] = $this->newElection( reset( $info ) );

Follow-up revisions

RevisionCommit summaryAuthorDate
r813941.17: MFT r81026, r81116, r81155, r81201, r81204, r81205, r81220, r81235, r81...catrope15:33, 2 February 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r64483Follow-ups to r58887. There might be some stuff from my configuration interf...happy-melon11:55, 1 April 2010

Status & tagging log