r104890 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104889‎ | r104890 | r104891 >
Date:19:56, 1 December 2011
Author:awjrichards
Status:ok
Tags:
Comment:
Modified paths:
  • /branches/wmf/1.18wmf1/extensions/ContributionReporting (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/ContributionReporting/ContributionHistory_body.php (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/ContributionReporting/ContributionReporting.php (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/ContributionReporting/ContributionStatistics_body.php (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/ContributionReporting/ContributionTrackingStatistics_body.php (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/ContributionReporting/FundraiserStatistics_body.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.18wmf1/extensions/ContributionReporting/ContributionReporting.php
@@ -145,29 +145,17 @@
146146 $wgHooks['ParserFirstCallInit'][] = 'efContributionReportingSetup';
147147 $wgHooks['LanguageGetMagic'][] = 'efContributionReportingTotal_Magic';
148148
149 -/**
150 - * @param $parser Parser
151 - * @return bool
152 - */
153149 function efContributionReportingSetup( $parser ) {
154150 $parser->setFunctionHook( 'contributiontotal', 'efContributionReportingTotal_Render' );
155151 return true;
156152 }
157153
158 -/**
159 - * @param $magicWords array
160 - * @param $langCode string
161 - * @return bool
162 - */
163154 function efContributionReportingTotal_Magic( &$magicWords, $langCode ) {
164155 $magicWords['contributiontotal'] = array( 0, 'contributiontotal' );
165156 return true;
166157 }
167158
168159 // Automatically use a local or special database connection
169 -/**
170 - * @return DatabaseMysql
171 - */
172160 function efContributionReportingConnection() {
173161 global $wgContributionReportingDBserver, $wgContributionReportingDBname;
174162 global $wgContributionReportingDBuser, $wgContributionReportingDBpassword;
@@ -186,9 +174,6 @@
187175 return $db;
188176 }
189177
190 -/**
191 - * @return DatabaseMysql
192 - */
193178 function efContributionTrackingConnection() {
194179 global $wgContributionTrackingDBserver, $wgContributionTrackingDBname;
195180 global $wgContributionTrackingDBuser, $wgContributionTrackingDBpassword;
@@ -207,11 +192,6 @@
208193 return $db;
209194 }
210195
211 -/**
212 - * @param $start
213 - * @param $fudgeFactor
214 - * @return string
215 - */
216196 function efContributionReportingTotal( $start, $fudgeFactor ) {
217197 $db = efContributionReportingConnection();
218198
@@ -233,9 +213,6 @@
234214 return $output;
235215 }
236216
237 -/**
238 - * @return string
239 - */
240217 function efContributionReportingTotal_Render() {
241218 $args = func_get_args();
242219 array_shift( $args );
Property changes on: branches/wmf/1.18wmf1/extensions/ContributionReporting/ContributionReporting.php
___________________________________________________________________
Modified: svn:mergeinfo
243220 Merged /trunk/extensions/ContributionReporting/ContributionReporting.php:r104889
Index: branches/wmf/1.18wmf1/extensions/ContributionReporting/ContributionTrackingStatistics_body.php
@@ -205,12 +205,7 @@
206206
207207 /* Query Functions */
208208
209 - /**
210 - * Totals for today
211 - *
212 - * @param $timestamp string
213 - * @return array
214 - */
 209+ // Totals for today
215210 public function getDayTotals( $timestamp = 0 ) {
216211 $range = array();
217212 $end_format = 'Ymd235959';
@@ -255,21 +250,15 @@
256251
257252 );
258253
259 - $result = array();
260254 foreach ( $res as $row ) {
261 - foreach( $row as $value ) {
 255+ foreach( $row as $key => $value ) {
262256 $result[] = $value;
263257 }
264258 }
265259 return $result;
266260 }
267261
268 - /**
269 - * Given a day figure out what its week bounds are
270 - *
271 - * @param $day
272 - * @return array
273 - */
 262+ // Given a day figure out what its week bounds are
274263 public function weekRange( $day ) {
275264 $day = wfTimestamp( TS_UNIX, $day );
276265 $start = ( date( 'w', $day ) == 0) ? $day : strtotime('last sunday', $day ); // Use current Sunday
Property changes on: branches/wmf/1.18wmf1/extensions/ContributionReporting/ContributionTrackingStatistics_body.php
___________________________________________________________________
Modified: svn:mergeinfo
277266 Merged /trunk/extensions/ContributionReporting/ContributionTrackingStatistics_body.php:r104889
Index: branches/wmf/1.18wmf1/extensions/ContributionReporting/FundraiserStatistics_body.php
@@ -15,7 +15,7 @@
1616 }
1717
1818 public function execute( $sub ) {
19 - global $wgRequest, $wgOut, $wgLang, $wgScriptPath, $egFundraiserStatisticsFundraisers;
 19+ global $wgRequest, $wgOut, $wgUser, $wgLang, $wgScriptPath, $egFundraiserStatisticsFundraisers;
2020
2121 $showYear = array();
2222 foreach ( $egFundraiserStatisticsFundraisers as $fundraiser ) {
@@ -242,7 +242,7 @@
243243 Xml::tags(
244244 'table',
245245 array( 'cellpadding' => 0, 'cellspacing' => 0, 'border' => 0 ),
246 - Xml::tags( 'tr', null, implode( $chart['data'] ) ) // FIXME: Missing parameter to implode
 246+ Xml::tags( 'tr', null, implode( $chart['data'] ) )
247247 )
248248 );
249249 $first = false;
@@ -300,7 +300,7 @@
301301 );
302302 $result = array();
303303 $ytd = 0;
304 - foreach( $select as $row ) {
 304+ while ( $row = $dbr->fetchRow( $select ) ) {
305305 $row[] = $ytd += $row[1]; // YTD
306306 $result[] = $row;
307307 }
@@ -364,10 +364,6 @@
365365 return null;
366366 }
367367
368 - /**
369 - * @param $values
370 - * @return string
371 - */
372368 private function dropDownList ( $values ) {
373369 $dropDown = '';
374370 foreach ( $values as $value ) {
Property changes on: branches/wmf/1.18wmf1/extensions/ContributionReporting/FundraiserStatistics_body.php
___________________________________________________________________
Modified: svn:mergeinfo
375371 Merged /trunk/extensions/ContributionReporting/FundraiserStatistics_body.php:r104889
Index: branches/wmf/1.18wmf1/extensions/ContributionReporting/ContributionHistory_body.php
@@ -11,6 +11,7 @@
1212 $wgOut->redirect( SpecialPage::getTitleFor( 'FundraiserStatistics' )->getFullURL() );
1313 return;
1414
 15+
1516 if ( !preg_match( '/^[a-z-]+$/', $language ) ) {
1617 $language = 'en';
1718 }
Property changes on: branches/wmf/1.18wmf1/extensions/ContributionReporting/ContributionHistory_body.php
___________________________________________________________________
Modified: svn:mergeinfo
1819 Merged /trunk/extensions/ContributionReporting/ContributionHistory_body.php:r104889
Index: branches/wmf/1.18wmf1/extensions/ContributionReporting/ContributionStatistics_body.php
@@ -275,10 +275,6 @@
276276
277277 /* Query Functions */
278278
279 - /**
280 - * @param $limit int
281 - * @return array
282 - */
283279 public function getDailyTotals( $limit = 30 ) {
284280 // Get connection
285281 $dbr = efContributionReportingConnection();
@@ -374,9 +370,6 @@
375371 return $totals;
376372 }
377373
378 - /**
379 - * @return array
380 - */
381374 public function getCurrencyTotals() {
382375 // Get connection
383376 $dbr = efContributionReportingConnection();
@@ -506,10 +499,6 @@
507500 );
508501 }
509502
510 - /**
511 - * @param $dbr DatabaseBase
512 - * @return array
513 - */
514503 protected function dateConds( $dbr ) {
515504 return
516505 array(
Property changes on: branches/wmf/1.18wmf1/extensions/ContributionReporting/ContributionStatistics_body.php
___________________________________________________________________
Modified: svn:mergeinfo
517506 Merged /trunk/extensions/ContributionReporting/ContributionStatistics_body.php:r104889
Property changes on: branches/wmf/1.18wmf1/extensions/ContributionReporting
___________________________________________________________________
Modified: svn:mergeinfo
518507 Merged /trunk/extensions/ContributionReporting:r104889

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r104889Revert r104370awjrichards19:55, 1 December 2011

Status & tagging log