From: Sam Reed Date: Wed, 31 Aug 2011 14:47:08 +0000 (+0000) Subject: Tidy up w/c X-Git-Tag: 1.31.0-rc.0~27996 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=3e928b4d331a93b6ae7498d87279082abadd0227;p=lhc%2Fweb%2Fwiklou.git Tidy up w/c Remove trailing whitespace, add some documentation --- diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 9b10628fa2..ff626620d5 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -1895,7 +1895,7 @@ class OutputPage extends ContextSource { * * showErrorPage( 'titlemsg', 'pagetextmsg', array( 'param1', 'param2' ) ); * showErrorPage( 'titlemsg', $messageObject ); - * + * * @param $title String: message key for page title * @param $msg Mixed: message key (string) for page text, or a Message object * @param $params Array: message parameters; ignored if $msg is a Message object @@ -3039,7 +3039,7 @@ $distantTemplates ResourceLoaderModule::TYPE_STYLES ); } - + // Add stuff in $otherTags (previewed user CSS if applicable) $ret .= $otherTags; return $ret; diff --git a/includes/Title.php b/includes/Title.php index c21b63f068..b0cd7ca7d2 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -47,7 +47,6 @@ class Title { */ const GAID_FOR_UPDATE = 1; - /** * @name Private member variables * Please use the accessor functions instead. @@ -759,7 +758,7 @@ class Title { /** * Return the prefixed title with spaces _without_ the interwiki prefix - * + * * @return \type{\string} the title, prefixed by the namespace but not by the interwiki prefix, with spaces */ public function getSemiPrefixedText() { @@ -768,7 +767,7 @@ class Title { $s = str_replace( '_', ' ', $s ); $this->mSemiPrefixedText = $s; } - return $this->mSemiPrefixedText; + return $this->mSemiPrefixedText; } /** @@ -999,7 +998,7 @@ class Title { public function escapeFullURL( $query = '' ) { return htmlspecialchars( $this->getFullURL( $query ) ); } - + /** * HTML-escaped version of getCanonicalURL() */ @@ -1011,7 +1010,7 @@ class Title { * Get the URL form for an internal link. * - Used in various Squid-related code, in case we have a different * internal hostname for the server from the exposed one. - * + * * This uses $wgInternalServer to qualify the path, or $wgServer * if $wgInternalServer is not set. If the server variable used is * protocol-relative, the URL will be expanded to http:// @@ -1036,9 +1035,9 @@ class Title { * Get the URL for a canonical link, for use in things like IRC and * e-mail notifications. Uses $wgCanonicalServer and the * GetCanonicalURL hook. - * + * * NOTE: Unlike getInternalURL(), the canonical URL includes the fragment - * + * * @param $query string An optional query string * @param $variant string Language variant of URL (for sr, zh, ...) * @return string The URL @@ -3380,7 +3379,7 @@ class Title { array( 'rc_timestamp' => $rcts, 'rc_namespace' => $newns, 'rc_title' => $newdbk, 'rc_new' => 1 ), __METHOD__ ); - + if ( $wgEnableInterwikiTemplatesTracking && $wgGlobalDatabase ) { $dbw2 = wfGetDB( DB_MASTER, array(), $wgGlobalDatabase ); $dbw2->delete( 'globaltemplatelinks', diff --git a/includes/WebRequest.php b/includes/WebRequest.php index 90d5346c11..449de7a594 100644 --- a/includes/WebRequest.php +++ b/includes/WebRequest.php @@ -167,10 +167,16 @@ class WebRequest { return $proto . '://' . IP::combineHostAndPort( $host, $port, $stdPort ); } + /** + * @return array + */ public static function detectProtocolAndStdPort() { return ( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] == 'on' ) ? array( 'https', 443 ) : array( 'http', 80 ); } + /** + * @return string + */ public static function detectProtocol() { list( $proto, $stdPort ) = self::detectProtocolAndStdPort(); return $proto; @@ -603,7 +609,7 @@ class WebRequest { * Return the request URI with the canonical service and hostname, path, * and query string. This will be suitable for use as an absolute link * in HTML or other output. - * + * * If $wgServer is protocol-relative, this will return a fully * qualified URL with the protocol that was used for this request. * @@ -921,6 +927,10 @@ HTML; * if there was no dot before the question mark (bug 28235). * * @deprecated Use checkUrlExtension(). + * + * @param $extWhitelist array + * + * @return bool */ public function isPathInfoBad( $extWhitelist = array() ) { global $wgScriptExtension; @@ -1180,15 +1190,26 @@ class FauxRequest extends WebRequest { throw new MWException( "{$method}() not implemented" ); } + /** + * @param $name string + * @param $default string + * @return string + */ public function getText( $name, $default = '' ) { # Override; don't recode since we're using internal data return (string)$this->getVal( $name, $default ); } + /** + * @return Array + */ public function getValues() { return $this->data; } + /** + * @return array + */ public function getQueryValues() { if ( $this->wasPosted ) { return array(); @@ -1197,6 +1218,9 @@ class FauxRequest extends WebRequest { } } + /** + * @return bool + */ public function wasPosted() { return $this->wasPosted; } @@ -1209,10 +1233,18 @@ class FauxRequest extends WebRequest { $this->notImplemented( __METHOD__ ); } + /** + * @param $name + * @return bool|string + */ public function getHeader( $name ) { return isset( $this->headers[$name] ) ? $this->headers[$name] : false; } + /** + * @param $name string + * @param $val string + */ public function setHeader( $name, $val ) { $this->headers[$name] = $val; } @@ -1230,14 +1262,25 @@ class FauxRequest extends WebRequest { return $this->session; } + /** + * @param array $extWhitelist + * @return bool + */ public function isPathInfoBad( $extWhitelist = array() ) { return false; } + /** + * @param array $extWhitelist + * @return bool + */ public function checkUrlExtension( $extWhitelist = array() ) { return true; } + /** + * @return string + */ protected function getRawIP() { return '127.0.0.1'; }