r104889 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104888‎ | r104889 | r104890 >
Date:19:55, 1 December 2011
Author:awjrichards
Status:ok
Tags:
Comment:
Revert r104370
Modified paths:
  • /trunk/extensions/ContributionReporting/ContributionHistory_body.php (modified) (history)
  • /trunk/extensions/ContributionReporting/ContributionReporting.php (modified) (history)
  • /trunk/extensions/ContributionReporting/ContributionStatistics_body.php (modified) (history)
  • /trunk/extensions/ContributionReporting/ContributionTrackingStatistics_body.php (modified) (history)
  • /trunk/extensions/ContributionReporting/FundraiserStatistics_body.php (modified) (history)

Diff [purge]

Index: trunk/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 );
Index: trunk/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
Index: trunk/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 ) {
Index: trunk/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 }
Index: trunk/extensions/ContributionReporting/ContributionStatistics_body.php
@@ -274,10 +274,6 @@
275275
276276 /* Query Functions */
277277
278 - /**
279 - * @param $limit int
280 - * @return array
281 - */
282278 public function getDailyTotals( $limit = 30 ) {
283279 // Get connection
284280 $dbr = efContributionReportingConnection();
@@ -373,9 +369,6 @@
374370 return $totals;
375371 }
376372
377 - /**
378 - * @return array
379 - */
380373 public function getCurrencyTotals() {
381374 // Get connection
382375 $dbr = efContributionReportingConnection();
@@ -505,10 +498,6 @@
506499 );
507500 }
508501
509 - /**
510 - * @param $dbr DatabaseBase
511 - * @return array
512 - */
513502 protected function dateConds( $dbr ) {
514503 return
515504 array(

Follow-up revisions

RevisionCommit summaryAuthorDate
r104890MFT r104889awjrichards19:56, 1 December 2011
r104904fixing bad module definition, restoring some of Reedys changes that didnt bre...kaldari22:26, 1 December 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r104370Comments...reedy22:56, 27 November 2011

Status & tagging log