Index: branches/wmf/1.18wmf1/extensions/FlaggedRevs/dataclasses/FlaggedRevsStats.php |
— | — | @@ -197,11 +197,19 @@ |
198 | 198 | } |
199 | 199 | |
200 | 200 | private function getReviewTimesAnons( $dbCache ) { |
| 201 | + $result = array( |
| 202 | + 'average' => 0, |
| 203 | + 'median' => 0, |
| 204 | + 'percTable' => array(), |
| 205 | + 'sampleSize' => 0, |
| 206 | + 'sampleStartTS' => null, |
| 207 | + 'sampleEndTS' => null |
| 208 | + ); |
| 209 | + if ( FlaggedRevs::useOnlyIfProtected() ) { |
| 210 | + return $result; // disabled |
| 211 | + } |
201 | 212 | $aveRT = $medianRT = 0; |
202 | 213 | $rPerTable = array(); // review wait percentiles |
203 | | - if ( FlaggedRevs::useOnlyIfProtected() ) { |
204 | | - return array( $aveRT, $medianRT, $rPerTable ); // disabled |
205 | | - } |
206 | 214 | $nowUnix = wfTimestamp( TS_UNIX ); // current time in UNIX TS |
207 | 215 | # Only go so far back...otherwise we will get garbage values due to |
208 | 216 | # the fact that FlaggedRevs wasn't enabled until after a while. |
— | — | @@ -351,15 +359,14 @@ |
352 | 360 | $rPerTable[$percentile] = $times[$rank]; |
353 | 361 | } |
354 | 362 | #echo "(sampled ".count($times)." edits)..."; |
| 363 | + $result['average'] = $aveRT; |
| 364 | + $result['median'] = $medianRT; |
| 365 | + $result['percTable'] = $rPerTable; |
| 366 | + $result['sampleSize'] = count( $times ); |
| 367 | + $result['sampleStartTS'] = $minTSUnix; |
| 368 | + $result['sampleEndTS'] = $maxTSUnix; |
355 | 369 | } |
356 | 370 | |
357 | | - return array( |
358 | | - 'average' => $aveRT, |
359 | | - 'median' => $medianRT, |
360 | | - 'percTable' => $rPerTable, |
361 | | - 'sampleSize' => count( $times ), |
362 | | - 'sampleStartTS' => $minTSUnix, |
363 | | - 'sampleEndTS' => $maxTSUnix |
364 | | - ); |
| 371 | + return $result; |
365 | 372 | } |
366 | 373 | } |