r75322 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75321‎ | r75322 | r75323 >
Date:17:14, 24 October 2010
Author:reedy
Status:ok
Tags:
Comment:
Explicit class variable definition. Swap a while for foreach
Modified paths:
  • /trunk/extensions/CodeReview/backend/CodeComment.php (modified) (history)
  • /trunk/extensions/CodeReview/backend/CodeRepository.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/backend/CodeRepository.php
@@ -5,6 +5,8 @@
66 static $userLinks = array();
77 static $authorLinks = array();
88
 9+ public $mId, $mName, $mPath, $mViewVc, $mBugzilla;
 10+
911 public static function newFromName( $name ) {
1012 $dbw = wfGetDB( DB_MASTER );
1113 $row = $dbw->selectRow(
@@ -150,7 +152,7 @@
151153 'ORDER BY' => 'revs DESC', 'LIMIT' => 500 )
152154 );
153155 $tags = array();
154 - while ( $row = $dbr->fetchObject( $res ) ) {
 156+ foreach( $res as $row ) {
155157 $tags[] = $row->ct_tag;
156158 }
157159 $wgMemc->set( $key, $tags, 3600 * 3 );
Index: trunk/extensions/CodeReview/backend/CodeComment.php
@@ -2,6 +2,8 @@
33 if ( !defined( 'MEDIAWIKI' ) ) die();
44
55 class CodeComment {
 6+ public $id, $text, $user, $userText, $timestamp, $review, $sortkey, $attrib, $removed, $added;
 7+
68 function __construct( $rev ) {
79 $this->rev = $rev;
810 }

Status & tagging log