r75469 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75468‎ | r75469 | r75470 >
Date:20:32, 26 October 2010
Author:reedy
Status:ok
Tags:
Comment:
Purge quite a few unused variables
Modified paths:
  • /trunk/extensions/FlaggedRevs/FRExtraCacheUpdate.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FRInclusionManager.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedArticleView.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevsLogs.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/api/ApiQueryFlagged.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/api/ApiQueryOldreviewedpages.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/api/ApiQueryReviewedpages.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/api/ApiQueryUnreviewedpages.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/forms/RevisionReviewForm.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/maintenance/flagToSemiProtect.inc (modified) (history)
  • /trunk/extensions/FlaggedRevs/maintenance/pruneRevData.inc (modified) (history)
  • /trunk/extensions/FlaggedRevs/maintenance/reviewAllPages.inc (modified) (history)
  • /trunk/extensions/FlaggedRevs/maintenance/tests/FRInclusionManagerTest.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/maintenance/reviewAllPages.inc
@@ -36,7 +36,6 @@
3737 $frev = FlaggedRevision::newFromTitle( $title, $row->page_latest, FR_MASTER );
3838 # Should exist, but to be safe...
3939 if( !$frev && $rev && FlaggedRevs::inReviewNamespace( $title ) ) {
40 - $text = $rev->getText();
4140 $article = new Article( $title );
4241 $db->begin();
4342 FlaggedRevs::autoReviewEdit( $article, $user, $rev, $flags, true );
Index: trunk/extensions/FlaggedRevs/maintenance/tests/FRInclusionManagerTest.php
@@ -88,7 +88,7 @@
8989 public function testReviewedTemplateVersions() {
9090 $im = FRInclusionManager::singleton();
9191 $im->setReviewedVersions( self::$inputTemplates, self::$inputFiles );
92 - foreach ( self::$reviewedOutputTemplates as $x => $triple ) {
 92+ foreach ( self::$reviewedOutputTemplates as $triple ) {
9393 list($test,$ns,$dbKey,$expId) = $triple;
9494 $title = Title::makeTitleSafe( $ns, $dbKey );
9595 $actual = $im->getReviewedTemplateVersion( $title );
@@ -99,7 +99,7 @@
100100 public function testReviewedFileVersions() {
101101 $im = FRInclusionManager::singleton();
102102 $im->setReviewedVersions( self::$inputTemplates, self::$inputFiles );
103 - foreach ( self::$reviewedOutputFiles as $x => $triple ) {
 103+ foreach ( self::$reviewedOutputFiles as $triple ) {
104104 list($test,$dbKey,$expTS,$expSha1) = $triple;
105105 $title = Title::makeTitleSafe( NS_FILE, $dbKey );
106106 list($actualTS,$actualSha1) = $im->getReviewedFileVersion( $title );
@@ -112,7 +112,7 @@
113113 $im = FRInclusionManager::singleton();
114114 $im->setReviewedVersions( array(), array() );
115115 $im->setStableVersionCache( self::$inputTemplates, self::$inputFiles );
116 - foreach ( self::$stableOutputTemplates as $x => $triple ) {
 116+ foreach ( self::$stableOutputTemplates as $triple ) {
117117 list($test,$ns,$dbKey,$expId) = $triple;
118118 $title = Title::makeTitleSafe( $ns, $dbKey );
119119 $actual = $im->getStableTemplateVersion( $title );
@@ -124,7 +124,7 @@
125125 $im = FRInclusionManager::singleton();
126126 $im->setReviewedVersions( array(), array() );
127127 $im->setStableVersionCache( self::$inputTemplates, self::$inputFiles );
128 - foreach ( self::$stableOutputFiles as $x => $triple ) {
 128+ foreach ( self::$stableOutputFiles as $triple ) {
129129 list($test,$dbKey,$expTS,$expSha1) = $triple;
130130 $title = Title::makeTitleSafe( NS_FILE, $dbKey );
131131 list($actualTS,$actualSha1) = $im->getStableFileVersion( $title );
Index: trunk/extensions/FlaggedRevs/maintenance/flagToSemiProtect.inc
@@ -46,7 +46,6 @@
4747 $limit = $expiry = array();
4848 $desc = array(); // for output
4949 foreach ( $title->getRestrictionTypes() as $type ) {
50 - $newLimit = $newExpiry = '';
5150 # Get existing restrictions for this action
5251 $oldLimit = $title->getRestrictions( $type ); // array
5352 $oldExpiry = $title->getRestrictionExpiry( $type ); // MW_TS
Index: trunk/extensions/FlaggedRevs/maintenance/pruneRevData.inc
@@ -26,7 +26,6 @@
2727 $tDeleted = $fDeleted = 0; // tallies
2828
2929 $newerRevs = 50;
30 - $cutoff = $db->timestamp( time() - 30*24*3600 );
3130 $cutoff = $db->timestamp( time() - 3600 );
3231 while( $blockEnd <= $end ) {
3332 echo "...doing fp_page_id from $blockStart to $blockEnd\n";
Index: trunk/extensions/FlaggedRevs/forms/RevisionReviewForm.php
@@ -718,7 +718,6 @@
719719 }
720720
721721 # Get versions of templates/files used
722 - $imageParams = $templateParams = $fileVersion = '';
723722 if ( $getPOut ) {
724723 $pOutput = false;
725724 # Current version: try parser cache
@@ -804,14 +803,12 @@
805804 * Generates a main tag inputs (checkboxes/radios/selects) for review form
806805 */
807806 private static function ratingInputs( $user, $flags, $disabled, $reviewed ) {
808 - $form = '';
809807 # Get all available tags for this page/user
810808 list( $labels, $minLevels ) = self::ratingFormTags( $user, $flags );
811809 if ( $labels === false ) {
812810 $disabled = true; // a tag is unsettable
813811 }
814812 $dimensions = FlaggedRevs::getDimensions();
815 - $tags = array_keys( $dimensions );
816813 # If there are no tags, make one checkbox to approve/unapprove
817814 if ( FlaggedRevs::binaryFlagging() ) {
818815 return '';
Index: trunk/extensions/FlaggedRevs/FRExtraCacheUpdate.php
@@ -38,10 +38,11 @@
3939
4040 protected function insertJobs( ResultWrapper $res ) {
4141 $numRows = $res->numRows();
42 - if ( !$numRows ) return; // sanity check
 42+ if ( !$numRows ) {
 43+ return; // sanity check
 44+ }
4345 $numBatches = ceil( $numRows / $this->mRowsPerJob );
4446 $realBatchSize = ceil( $numRows / $numBatches );
45 - $start = false;
4647 $jobs = array();
4748 do {
4849 $first = $last = false; // first/last page_id of this batch
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
@@ -53,7 +53,7 @@
5454 if ( !$fa || !$fa->isReviewable() ) {
5555 return true;
5656 }
57 - global $wgJsMimeType, $wgFlaggedRevStyleVersion, $wgStylePath, $wgStyleVersion;
 57+ global $wgJsMimeType, $wgFlaggedRevStyleVersion;
5858 $stylePath = FlaggedRevs::styleUrlPath();
5959 # Get JS/CSS file locations
6060 $encCssFile = htmlspecialchars( "$stylePath/flaggedrevs.css?$wgFlaggedRevStyleVersion" );
@@ -140,7 +140,7 @@
141141 }
142142 $spPages = array( 'UnreviewedPages', 'PendingChanges', 'ProblemChanges',
143143 'Watchlist', 'Recentchanges', 'Contributions', 'Recentchangeslinked' );
144 - foreach ( $spPages as $n => $key ) {
 144+ foreach ( $spPages as $key ) {
145145 if ( $title->isSpecial( $key ) ) {
146146 global $wgScriptPath, $wgFlaggedRevsStylePath, $wgFlaggedRevStyleVersion;
147147 $stylePath = str_replace( '$wgScriptPath',
@@ -887,7 +887,6 @@
888888 global $wgFlaggedRevsRCCrap;
889889 if ( $wgFlaggedRevsRCCrap ) {
890890 // Is this page in patrollable namespace?
891 - $patrol = $record = false;
892891 if ( FlaggedRevs::inPatrolNamespace( $rc->getTitle() ) ) {
893892 # Bots and users with 'autopatrol' have edits to patrollable
894893 # pages marked automatically on edit.
Index: trunk/extensions/FlaggedRevs/FlaggedRevsLogs.php
@@ -35,7 +35,6 @@
3636 if ( !$title ) {
3737 return ''; // sanity check
3838 }
39 - $text = '';
4039 if ( $skin ) {
4140 $titleLink = $skin->link( $title, $title->getPrefixedText() );
4241 $text = wfMsgHtml( "stable-logentry-{$action}", $titleLink );
Index: trunk/extensions/FlaggedRevs/api/ApiQueryFlagged.php
@@ -44,7 +44,6 @@
4545 $res = $this->select( __METHOD__ );
4646
4747 $result = $this->getResult();
48 - $db = $this->getDB();
4948 foreach( $res as $row ) {
5049 $pageid = $row->fp_page_id;
5150 $data = array(
Index: trunk/extensions/FlaggedRevs/api/ApiQueryOldreviewedpages.php
@@ -108,7 +108,6 @@
109109
110110 $data = array ();
111111 $count = 0;
112 - $db = $this->getDB();
113112 foreach( $res as $row ) {
114113 if ( ++$count > $limit ) {
115114 // We've reached the one extra which shows that there are
Index: trunk/extensions/FlaggedRevs/api/ApiQueryReviewedpages.php
@@ -86,7 +86,6 @@
8787
8888 $data = array ();
8989 $count = 0;
90 - $db = $this->getDB();
9190 foreach( $res as $row ) {
9291 if ( ++$count > $limit ) {
9392 // We've reached the one extra which shows that there are
Index: trunk/extensions/FlaggedRevs/api/ApiQueryUnreviewedpages.php
@@ -85,7 +85,6 @@
8686
8787 $data = array ();
8888 $count = 0;
89 - $db = $this->getDB();
9089 foreach( $res as $row ) {
9190 if ( ++$count > $limit ) {
9291 // We've reached the one extra which shows that there are
Index: trunk/extensions/FlaggedRevs/FRInclusionManager.php
@@ -67,7 +67,6 @@
6868 * @return void
6969 */
7070 public function stabilizeParserOutput( Title $title, FlaggedRevision $frev ) {
71 - $tRevVersions = $fRevVersions = array(); // review time versions
7271 $tStbVersions = $fStbVersions = array(); // stable versions
7372 $tRevVersions = $frev->getTemplateVersions();
7473 $fRevVersions = $frev->getFileVersions();
Index: trunk/extensions/FlaggedRevs/FlaggedArticleView.php
@@ -620,7 +620,6 @@
621621 $this->setReviewNotes( $srev );
622622
623623 # Get parsed stable version and output HTML
624 - $redirHtml = '';
625624 $parserOut = FlaggedRevs::getPageCache( $this->article, $wgUser );
626625 if ( !$parserOut ) {
627626 $text = $srev->getRevText();
@@ -867,7 +866,6 @@
868867 return true;
869868 }
870869 $items = array();
871 - $tag = $warning = $prot = '';
872870 # Show stabilization log
873871 $log = $this->stabilityLogNotice();
874872 if ( $log ) $items[] = $log;
@@ -1474,7 +1472,6 @@
14751473 }
14761474
14771475 protected static function getDiffRevMsgAndClass( Revision $rev, $stableId ) {
1478 - $msg = '';
14791476 $tier = FlaggedRevs::getRevQuality( $rev->getPage(), $rev->getId() );
14801477 if ( $tier !== false ) {
14811478 $msg = $tier

Status & tagging log