From 94bf573c03f7c8a538af1a93511c014a8f22d4b9 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Wed, 1 Jun 2011 16:27:46 +0000 Subject: [PATCH] Remove some unused variables, add/improve some documentation --- includes/diff/DifferenceEngine.php | 35 +++++++++++++++++++++++++----- maintenance/compareParsers.php | 1 - maintenance/importDump.php | 4 ++-- 3 files changed, 32 insertions(+), 8 deletions(-) diff --git a/includes/diff/DifferenceEngine.php b/includes/diff/DifferenceEngine.php index 1cf98b492d..c7fca69bc4 100644 --- a/includes/diff/DifferenceEngine.php +++ b/includes/diff/DifferenceEngine.php @@ -57,10 +57,9 @@ class DifferenceEngine { /** * Constructor * @param $titleObj Title object that the diff is associated with - * @param $old Integer: old ID we want to show and diff with. - * @param $new String: either 'prev' or 'next'. - * @todo FIXME: $rcid ??? - * @param $rcid Integer: ??? FIXME (default 0) + * @param $old Integer old ID we want to show and diff with. + * @param $new String either 'prev' or 'next'. + * @param $rcid Integer ??? FIXME (default 0) * @param $refreshCache boolean If set, refreshes the diff cache * @param $unhide boolean If set, allow viewing deleted revs */ @@ -100,22 +99,37 @@ class DifferenceEngine { $this->unhide = $unhide; } + /** + * @param $value bool + */ function setReducedLineNumbers( $value = true ) { $this->mReducedLineNumbers = $value; } + /** + * @return Title + */ function getTitle() { return $this->mTitle; } + /** + * @return bool + */ function wasCacheHit() { return $this->mCacheHit; } + /** + * @return int + */ function getOldid() { return $this->mOldid; } + /** + * @return Bool|int + */ function getNewid() { return $this->mNewid; } @@ -626,6 +640,8 @@ CONTROL; /** * Get the diff text, send it to $wgOut * Returns false if the diff could not be generated, otherwise returns true + * + * @return bool */ function showDiff( $otitle, $ntitle, $notice = '' ) { global $wgOut; @@ -915,6 +931,8 @@ CONTROL; /** * Add the header to a diff body + * + * @return string */ static function addHeader( $diff, $otitle, $ntitle, $multi = '', $notice = '' ) { $header = ""; @@ -965,6 +983,8 @@ CONTROL; * If oldid is false, leave the corresponding revision object set * to false. This is impossible via ordinary user input, and is provided for * API convenience. + * + * @return bool */ function loadRevisionData() { global $wgLang, $wgUser; @@ -979,8 +999,9 @@ CONTROL; $this->mNewRev = $this->mNewid ? Revision::newFromId( $this->mNewid ) : Revision::newFromTitle( $this->mTitle ); - if ( !$this->mNewRev instanceof Revision ) + if ( !$this->mNewRev instanceof Revision ) { return false; + } // Update the new revision ID in case it was 0 (makes life easier doing UI stuff) $this->mNewid = $this->mNewRev->getId(); @@ -1094,6 +1115,8 @@ CONTROL; /** * Load the text of the revisions, as well as revision data. + * + * @return bool */ function loadText() { if ( $this->mTextLoaded == 2 ) { @@ -1123,6 +1146,8 @@ CONTROL; /** * Load the text of the new revision, not the old one + * + * @return bool */ function loadNewText() { if ( $this->mTextLoaded >= 1 ) { diff --git a/maintenance/compareParsers.php b/maintenance/compareParsers.php index 55358464ef..4f8facc2a6 100644 --- a/maintenance/compareParsers.php +++ b/maintenance/compareParsers.php @@ -32,7 +32,6 @@ require_once( dirname( __FILE__ ) . '/dumpIterator.php' ); class CompareParsers extends DumpIterator { private $count = 0; - private $startTime; public function __construct() { parent::__construct(); diff --git a/maintenance/importDump.php b/maintenance/importDump.php index 484d62ef5e..c160b0368a 100644 --- a/maintenance/importDump.php +++ b/maintenance/importDump.php @@ -83,9 +83,9 @@ TEXT; } if( $this->hasArg() ) { - $result = $this->importFromFile( $this->getArg() ); + $this->importFromFile( $this->getArg() ); } else { - $result = $this->importFromStdin(); + $this->importFromStdin(); } $this->output( "Done!\n" ); -- 2.20.1