r113042 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113041‎ | r113042 | r113043 >
Date:15:23, 5 March 2012
Author:reedy
Status:ok
Tags:
Comment:
Documentation updates

Normalise method returns
Modified paths:
  • /trunk/phase3/includes/AjaxResponse.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryLogEvents.php (modified) (history)
  • /trunk/phase3/includes/interwiki/Interwiki.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/interwiki/Interwiki.php
@@ -130,6 +130,7 @@
131131 $value = '';
132132 }
133133
 134+
134135 return $value;
135136 }
136137
Index: trunk/phase3/includes/api/ApiQueryLogEvents.php
@@ -195,6 +195,7 @@
196196 * @param $type string
197197 * @param $action string
198198 * @param $ts
 199+ * @param $legacy bool
199200 * @return array
200201 */
201202 public static function addLogParams( $result, &$vals, $params, $type, $action, $ts, $legacy = false ) {
Index: trunk/phase3/includes/AjaxResponse.php
@@ -34,6 +34,9 @@
3535 /** Content of our HTTP response */
3636 private $mText;
3737
 38+ /**
 39+ * @param $text string|null
 40+ */
3841 function __construct( $text = null ) {
3942 $this->mCacheDuration = null;
4043 $this->mVary = null;
@@ -69,21 +72,28 @@
7073 $this->mDisabled = true;
7174 }
7275
73 - /** Add content to the response */
 76+ /**
 77+ * Add content to the response
 78+ * @param $text string
 79+ */
7480 function addText( $text ) {
7581 if ( ! $this->mDisabled && $text ) {
7682 $this->mText .= $text;
7783 }
7884 }
7985
80 - /** Output text */
 86+ /**
 87+ * Output text
 88+ */
8189 function printText() {
8290 if ( ! $this->mDisabled ) {
8391 print $this->mText;
8492 }
8593 }
8694
87 - /** Construct the header and output it */
 95+ /**
 96+ * Construct the header and output it
 97+ */
8898 function sendHeaders() {
8999 global $wgUseSquid, $wgUseESI;
90100
@@ -139,9 +149,10 @@
140150 /**
141151 * checkLastModified tells the client to use the client-cached response if
142152 * possible. If sucessful, the AjaxResponse is disabled so that
143 - * any future call to AjaxResponse::printText() have no effect. The method
144 - * returns true iff the response code was set to 304 Not Modified.
145 - * @return bool
 153+ * any future call to AjaxResponse::printText() have no effect.
 154+ *
 155+ * @param $timestamp string
 156+ * @return bool Returns true if the response code was set to 304 Not Modified.
146157 */
147158 function checkLastModified ( $timestamp ) {
148159 global $wgCachePages, $wgCacheEpoch, $wgUser;
@@ -149,17 +160,17 @@
150161
151162 if ( !$timestamp || $timestamp == '19700101000000' ) {
152163 wfDebug( "$fname: CACHE DISABLED, NO TIMESTAMP\n" );
153 - return;
 164+ return false;
154165 }
155166
156167 if ( !$wgCachePages ) {
157168 wfDebug( "$fname: CACHE DISABLED\n", false );
158 - return;
 169+ return false;
159170 }
160171
161172 if ( $wgUser->getOption( 'nocache' ) ) {
162173 wfDebug( "$fname: USER DISABLED CACHE\n", false );
163 - return;
 174+ return false;
164175 }
165176
166177 $timestamp = wfTimestamp( TS_MW, $timestamp );
@@ -192,6 +203,7 @@
193204 wfDebug( "$fname: client did not send If-Modified-Since header\n", false );
194205 $this->mLastModified = $lastmod;
195206 }
 207+ return false;
196208 }
197209
198210 /**

Status & tagging log