r89272 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89271‎ | r89272 | r89273 >
Date:16:27, 1 June 2011
Author:reedy
Status:ok
Tags:
Comment:
Remove some unused variables, add/improve some documentation
Modified paths:
  • /trunk/phase3/includes/diff/DifferenceEngine.php (modified) (history)
  • /trunk/phase3/maintenance/compareParsers.php (modified) (history)
  • /trunk/phase3/maintenance/importDump.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/importDump.php
@@ -83,9 +83,9 @@
8484 }
8585
8686 if( $this->hasArg() ) {
87 - $result = $this->importFromFile( $this->getArg() );
 87+ $this->importFromFile( $this->getArg() );
8888 } else {
89 - $result = $this->importFromStdin();
 89+ $this->importFromStdin();
9090 }
9191
9292 $this->output( "Done!\n" );
Index: trunk/phase3/maintenance/compareParsers.php
@@ -32,7 +32,6 @@
3333 class CompareParsers extends DumpIterator {
3434
3535 private $count = 0;
36 - private $startTime;
3736
3837 public function __construct() {
3938 parent::__construct();
Index: trunk/phase3/includes/diff/DifferenceEngine.php
@@ -57,10 +57,9 @@
5858 /**
5959 * Constructor
6060 * @param $titleObj Title object that the diff is associated with
61 - * @param $old Integer: old ID we want to show and diff with.
62 - * @param $new String: either 'prev' or 'next'.
63 - * @todo FIXME: $rcid ???
64 - * @param $rcid Integer: ??? FIXME (default 0)
 61+ * @param $old Integer old ID we want to show and diff with.
 62+ * @param $new String either 'prev' or 'next'.
 63+ * @param $rcid Integer ??? FIXME (default 0)
6564 * @param $refreshCache boolean If set, refreshes the diff cache
6665 * @param $unhide boolean If set, allow viewing deleted revs
6766 */
@@ -100,22 +99,37 @@
101100 $this->unhide = $unhide;
102101 }
103102
 103+ /**
 104+ * @param $value bool
 105+ */
104106 function setReducedLineNumbers( $value = true ) {
105107 $this->mReducedLineNumbers = $value;
106108 }
107109
 110+ /**
 111+ * @return Title
 112+ */
108113 function getTitle() {
109114 return $this->mTitle;
110115 }
111116
 117+ /**
 118+ * @return bool
 119+ */
112120 function wasCacheHit() {
113121 return $this->mCacheHit;
114122 }
115123
 124+ /**
 125+ * @return int
 126+ */
116127 function getOldid() {
117128 return $this->mOldid;
118129 }
119130
 131+ /**
 132+ * @return Bool|int
 133+ */
120134 function getNewid() {
121135 return $this->mNewid;
122136 }
@@ -626,6 +640,8 @@
627641 /**
628642 * Get the diff text, send it to $wgOut
629643 * Returns false if the diff could not be generated, otherwise returns true
 644+ *
 645+ * @return bool
630646 */
631647 function showDiff( $otitle, $ntitle, $notice = '' ) {
632648 global $wgOut;
@@ -915,6 +931,8 @@
916932
917933 /**
918934 * Add the header to a diff body
 935+ *
 936+ * @return string
919937 */
920938 static function addHeader( $diff, $otitle, $ntitle, $multi = '', $notice = '' ) {
921939 $header = "<table class='diff'>";
@@ -965,6 +983,8 @@
966984 * If oldid is false, leave the corresponding revision object set
967985 * to false. This is impossible via ordinary user input, and is provided for
968986 * API convenience.
 987+ *
 988+ * @return bool
969989 */
970990 function loadRevisionData() {
971991 global $wgLang, $wgUser;
@@ -979,8 +999,9 @@
9801000 $this->mNewRev = $this->mNewid
9811001 ? Revision::newFromId( $this->mNewid )
9821002 : Revision::newFromTitle( $this->mTitle );
983 - if ( !$this->mNewRev instanceof Revision )
 1003+ if ( !$this->mNewRev instanceof Revision ) {
9841004 return false;
 1005+ }
9851006
9861007 // Update the new revision ID in case it was 0 (makes life easier doing UI stuff)
9871008 $this->mNewid = $this->mNewRev->getId();
@@ -1094,6 +1115,8 @@
10951116
10961117 /**
10971118 * Load the text of the revisions, as well as revision data.
 1119+ *
 1120+ * @return bool
10981121 */
10991122 function loadText() {
11001123 if ( $this->mTextLoaded == 2 ) {
@@ -1123,6 +1146,8 @@
11241147
11251148 /**
11261149 * Load the text of the new revision, not the old one
 1150+ *
 1151+ * @return bool
11271152 */
11281153 function loadNewText() {
11291154 if ( $this->mTextLoaded >= 1 ) {

Status & tagging log