From 08e4a19369179ceccb6cab1769c8f3c7e34c6a7f Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Mon, 5 Mar 2012 15:23:04 +0000 Subject: [PATCH] Documentation updates Normalise method returns --- includes/AjaxResponse.php | 30 +++++++++++++++++++++--------- includes/api/ApiQueryLogEvents.php | 1 + includes/interwiki/Interwiki.php | 1 + 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/includes/AjaxResponse.php b/includes/AjaxResponse.php index ebf83de638..a395239277 100644 --- a/includes/AjaxResponse.php +++ b/includes/AjaxResponse.php @@ -34,6 +34,9 @@ class AjaxResponse { /** Content of our HTTP response */ private $mText; + /** + * @param $text string|null + */ function __construct( $text = null ) { $this->mCacheDuration = null; $this->mVary = null; @@ -69,21 +72,28 @@ class AjaxResponse { $this->mDisabled = true; } - /** Add content to the response */ + /** + * Add content to the response + * @param $text string + */ function addText( $text ) { if ( ! $this->mDisabled && $text ) { $this->mText .= $text; } } - /** Output text */ + /** + * Output text + */ function printText() { if ( ! $this->mDisabled ) { print $this->mText; } } - /** Construct the header and output it */ + /** + * Construct the header and output it + */ function sendHeaders() { global $wgUseSquid, $wgUseESI; @@ -139,9 +149,10 @@ class AjaxResponse { /** * checkLastModified tells the client to use the client-cached response if * possible. If sucessful, the AjaxResponse is disabled so that - * any future call to AjaxResponse::printText() have no effect. The method - * returns true iff the response code was set to 304 Not Modified. - * @return bool + * any future call to AjaxResponse::printText() have no effect. + * + * @param $timestamp string + * @return bool Returns true if the response code was set to 304 Not Modified. */ function checkLastModified ( $timestamp ) { global $wgCachePages, $wgCacheEpoch, $wgUser; @@ -149,17 +160,17 @@ class AjaxResponse { if ( !$timestamp || $timestamp == '19700101000000' ) { wfDebug( "$fname: CACHE DISABLED, NO TIMESTAMP\n" ); - return; + return false; } if ( !$wgCachePages ) { wfDebug( "$fname: CACHE DISABLED\n", false ); - return; + return false; } if ( $wgUser->getOption( 'nocache' ) ) { wfDebug( "$fname: USER DISABLED CACHE\n", false ); - return; + return false; } $timestamp = wfTimestamp( TS_MW, $timestamp ); @@ -192,6 +203,7 @@ class AjaxResponse { wfDebug( "$fname: client did not send If-Modified-Since header\n", false ); $this->mLastModified = $lastmod; } + return false; } /** diff --git a/includes/api/ApiQueryLogEvents.php b/includes/api/ApiQueryLogEvents.php index 0d07a25410..e017c4bdb6 100644 --- a/includes/api/ApiQueryLogEvents.php +++ b/includes/api/ApiQueryLogEvents.php @@ -195,6 +195,7 @@ class ApiQueryLogEvents extends ApiQueryBase { * @param $type string * @param $action string * @param $ts + * @param $legacy bool * @return array */ public static function addLogParams( $result, &$vals, $params, $type, $action, $ts, $legacy = false ) { diff --git a/includes/interwiki/Interwiki.php b/includes/interwiki/Interwiki.php index 3aaa1c52db..2dacd853f3 100644 --- a/includes/interwiki/Interwiki.php +++ b/includes/interwiki/Interwiki.php @@ -130,6 +130,7 @@ class Interwiki { $value = ''; } + return $value; } -- 2.20.1