r75478 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75477‎ | r75478 | r75479 >
Date:22:26, 26 October 2010
Author:reedy
Status:ok
Tags:
Comment:
Another purge of unused variables
Modified paths:
  • /trunk/extensions/FlaggedRevs/FRUserCounters.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedArticleView.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevsXML.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/forms/PageStabilityForm.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/maintenance/tests/FRUserCountersTest.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/maintenance/updateStats.inc (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/RevisionReview_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FRUserCounters.php
@@ -71,7 +71,7 @@
7272 */
7373 public static function saveUserParams( $uid, array $params, $dBName = false ) {
7474 $dbw = wfGetDB( DB_MASTER, array(), $dBName );
75 - $row = $dbw->replace( 'flaggedrevs_promote',
 75+ $dbw->replace( 'flaggedrevs_promote',
7676 array( 'frp_user_id' ),
7777 array( 'frp_user_id' => $uid,
7878 'frp_user_params' => self::flattenParams( $params ) ),
Index: trunk/extensions/FlaggedRevs/maintenance/tests/FRUserCountersTest.php
@@ -58,15 +58,15 @@
5959 $article = new Article( $title );
6060
6161 $copyP = $p;
62 - $changed = FRUserCounters::updateUserParams( $copyP, $article, "Manual edit comment" );
 62+ FRUserCounters::updateUserParams( $copyP, $article, "Manual edit comment" );
6363 $this->assertEquals( $p['editComments']+1, $copyP['editComments'], "Manual summary" );
6464
6565 $copyP = $p;
66 - $changed = FRUserCounters::updateUserParams( $copyP, $article, "/* section */" );
 66+ FRUserCounters::updateUserParams( $copyP, $article, "/* section */" );
6767 $this->assertEquals( $p['editComments'], $copyP['editComments'], "Auto summary" );
6868
6969 $copyP = $p;
70 - $changed = FRUserCounters::updateUserParams( $copyP, $article, "edit summary" );
 70+ FRUserCounters::updateUserParams( $copyP, $article, "edit summary" );
7171 $this->assertEquals( $p['totalContentEdits']+1, $copyP['totalContentEdits'],
7272 "Content edit count on content edit" );
7373 $expected = $p['uniqueContentPages'];
@@ -79,15 +79,15 @@
8080 $article = new Article( $title );
8181
8282 $copyP = $p;
83 - $changed = FRUserCounters::updateUserParams( $copyP, $article, "Manual edit comment" );
 83+ FRUserCounters::updateUserParams( $copyP, $article, "Manual edit comment" );
8484 $this->assertEquals( $p['editComments']+1, $copyP['editComments'], "Manual summary" );
8585
8686 $copyP = $p;
87 - $changed = FRUserCounters::updateUserParams( $copyP, $article, "/* section */" );
 87+ FRUserCounters::updateUserParams( $copyP, $article, "/* section */" );
8888 $this->assertEquals( $p['editComments'], $copyP['editComments'], "Auto summary" );
8989
9090 $copyP = $p;
91 - $changed = FRUserCounters::updateUserParams( $copyP, $article, "edit summary" );
 91+ FRUserCounters::updateUserParams( $copyP, $article, "edit summary" );
9292 $this->assertEquals( $p['totalContentEdits'], $copyP['totalContentEdits'],
9393 "Content edit count on non-content edit" );
9494 $this->assertEquals( $p['uniqueContentPages'], $copyP['uniqueContentPages'],
Index: trunk/extensions/FlaggedRevs/maintenance/updateStats.inc
@@ -184,7 +184,6 @@
185185 if ( $rows < 500 ) {
186186 $days = 90;
187187 $minTSUnix = $maxTSUnix - $days*86400;
188 - $encMinTS = $dbr->addQuotes( $dbr->timestamp( $minTSUnix ) );
189188 }
190189 }
191190 $sampleSize = 1500; // sample size
Index: trunk/extensions/FlaggedRevs/forms/PageStabilityForm.php
@@ -328,7 +328,7 @@
329329 # Insert a null revision...
330330 $dbw = wfGetDB( DB_MASTER );
331331 $nullRev = Revision::newNullRevision( $dbw, $article->getId(), $comment, true );
332 - $nullRevId = $nullRev->insertOn( $dbw );
 332+ $nullRev->insertOn( $dbw );
333333 # Update page record and touch page
334334 $article->updateRevisionOn( $dbw, $nullRev, $latest );
335335 wfRunHooks( 'NewRevisionFromEditComplete', array( $article, $nullRev, $latest ) );
Index: trunk/extensions/FlaggedRevs/specialpages/RevisionReview_body.php
@@ -143,7 +143,7 @@
144144 $editToken = ''; // edit token
145145 // Each ajax url argument is of the form param|val.
146146 // This means that there is no ugly order dependance.
147 - foreach ( $args as $x => $arg ) {
 147+ foreach ( $args as $arg ) {
148148 $set = explode( '|', $arg, 2 );
149149 if ( count( $set ) != 2 ) {
150150 return '<err#>' . wfMsgExt( 'revreview-failed', 'parseinline' );
Index: trunk/extensions/FlaggedRevs/FlaggedRevsXML.php
@@ -186,14 +186,7 @@
187187 $level = isset( $flags[$quality] ) ? $flags[$quality] : 0;
188188 $encValueText = wfMsgHtml( "revreview-$quality-$level" );
189189 $level = $flags[$quality];
190 - $minlevel = FlaggedRevs::getMinQL( $quality );
191 - if ( $level >= $minlevel ) {
192 - $classmarker = 2;
193 - } elseif ( $level > 0 ) {
194 - $classmarker = 1;
195 - } else {
196 - $classmarker = 0;
197 - }
 190+
198191 $levelmarker = $level * 20 + 20;
199192 if ( $prettyBox ) {
200193 $tag .= "<tr><td class='fr-text' valign='middle'>" .
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
@@ -483,7 +483,6 @@
484484 if ( isset( $pOutput->fr_fileSHA1Keys[$filename] ) ) {
485485 // Fetch file with $time to confirm the specified version exists
486486 $time = $pOutput->fr_fileSHA1Keys[$filename]['ts'];
487 - $sha1 = $pOutput->fr_fileSHA1Keys[$filename]['sha1'];
488487 }
489488 $title = Title::makeTitleSafe( NS_FILE, $filename );
490489 $file = wfFindFile( $title, array( 'time' => $time ) );
@@ -1946,7 +1945,6 @@
19471946 $output .= Xml::closeElement( 'select' );
19481947 # Get expiry dropdown <select>...
19491948 $scExpiryOptions = wfMsgForContent( 'protect-expiry-options' );
1950 - $showProtectOptions = ( $scExpiryOptions !== '-' && $isAllowed );
19511949 # Add the current expiry as an option
19521950 $expiryFormOptions = '';
19531951 if ( $config['expiry'] != 'infinity' ) {
Index: trunk/extensions/FlaggedRevs/FlaggedArticleView.php
@@ -224,7 +224,7 @@
225225 * Adds a quick review form on the bottom if needed
226226 */
227227 public function setPageContent( &$outputDone, &$useParserCache ) {
228 - global $wgRequest, $wgOut, $wgLang, $wgContLang;
 228+ global $wgRequest, $wgOut, $wgContLang;
229229 $this->load();
230230 # Only trigger on article view for content pages, not for protect/delete/hist...
231231 $action = $wgRequest->getVal( 'action', 'view' );
@@ -239,7 +239,7 @@
240240 return true;
241241 }
242242 $simpleTag = $old = $stable = false;
243 - $tag = $prot = '';
 243+ $tag = '';
244244 # Check the newest stable version.
245245 $srev = $this->article->getStableRev();
246246 $stableId = $srev ? $srev->getRevId() : 0;
@@ -279,7 +279,6 @@
280280 return true;
281281 }
282282 # Get flags and date
283 - $time = $wgLang->date( $frev->getTimestamp(), true );
284283 $flags = $frev->getTags();
285284 # Get quality level
286285 $quality = FlaggedRevs::isQuality( $flags );
@@ -384,7 +383,6 @@
385384 $time = $wgLang->date( $srev->getTimestamp(), true );
386385 # Get quality level
387386 $quality = FlaggedRevs::isQuality( $flags );
388 - $pristine = FlaggedRevs::isPristine( $flags );
389387 # Get stable version sync status
390388 $synced = $this->article->stableVersionIsSynced();
391389 if ( $synced ) {
@@ -393,7 +391,6 @@
394392 $this->maybeShowTopDiff( $srev, $quality ); // user may want diff (via prefs)
395393 }
396394 # If they are synced, do special styling
397 - $simpleTag = !$synced;
398395 # Give notice to newer users if an unreviewed edit was completed...
399396 if ( $wgRequest->getVal( 'shownotice' )
400397 && $this->article->getUserText() == $wgUser->getName() // FIXME: rawUserText?
@@ -401,7 +398,6 @@
402399 && !$wgUser->isAllowed( 'review' ) )
403400 {
404401 $revsSince = $this->article->getPendingRevCount();
405 - $tooltip = wfMsgHtml( 'revreview-draft-title' );
406402 $pending = $prot;
407403 if ( $this->showRatingIcon() ) {
408404 $pending .= FlaggedRevsXML::draftStatusIcon();
@@ -493,7 +489,6 @@
494490 $wgOut->setRevisionId( $frev->getRevId() );
495491 # Get quality level
496492 $quality = FlaggedRevs::isQuality( $flags );
497 - $pristine = FlaggedRevs::isPristine( $flags );
498493
499494 # Construct some tagging for non-printable outputs. Note that the pending
500495 # notice has all this info already, so don't do this if we added that already.
@@ -568,7 +563,6 @@
569564 $wgOut->setRevisionId( $srev->getRevId() );
570565 # Get quality level
571566 $quality = FlaggedRevs::isQuality( $flags );
572 - $pristine = FlaggedRevs::isPristine( $flags );
573567
574568 $synced = $this->article->stableVersionIsSynced();
575569 # Construct some tagging
@@ -870,7 +864,6 @@
871865 $log = $this->stabilityLogNotice();
872866 if ( $log ) $items[] = $log;
873867 # Check the newest stable version
874 - $quality = 0;
875868 $frev = $this->article->getStableRev();
876869 if ( $frev ) {
877870 $quality = $frev->getQuality();
@@ -1437,13 +1430,7 @@
14381431 */
14391432 protected static function diffReviewMarkers( FlaggedArticle $article, $oldRev, $newRev ) {
14401433 $form = '';
1441 - $oldRevQ = $newRevQ = false;
1442 - if ( $oldRev ) {
1443 - $oldRevQ = FlaggedRevs::getRevQuality( $oldRev->getPage(), $oldRev->getId() );
1444 - }
1445 - if ( $newRev ) {
1446 - $newRevQ = FlaggedRevs::getRevQuality( $newRev->getPage(), $newRev->getId() );
1447 - }
 1434+
14481435 $srev = $article->getStableRev();
14491436 $stableId = $srev ? $srev->getRevId() : 0;
14501437 # Diff between two revisions
@@ -1628,7 +1615,7 @@
16291616 return true; # PECL extension conflicts with the core DOM extension (see bug 13770)
16301617 } elseif ( isset( $buttons['save'] ) && extension_loaded( 'dom' ) ) {
16311618 $dom = new DOMDocument();
1632 - $result = $dom->loadXML( $buttons['save'] ); // load button XML from hook
 1619+ $dom->loadXML( $buttons['save'] ); // load button XML from hook
16331620 foreach ( $dom->getElementsByTagName( 'input' ) as $input ) { // one <input>
16341621 $input->setAttribute( 'value', wfMsg( 'revreview-submitedit' ) );
16351622 $input->setAttribute( 'title', // keep accesskey
@@ -1662,7 +1649,6 @@
16631650 * @return bool
16641651 */
16651652 protected function editRequiresReview( EditPage $editPage ) {
1666 - $title = $this->article->getTitle(); // convenience
16671653 if ( !$this->article->editsRequireReview() ) {
16681654 return false; // edits go live immediatly
16691655 } elseif ( $this->editWillBeAutoreviewed( $editPage ) ) {

Status & tagging log