r95871 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95870‎ | r95871 | r95872 >
Date:14:47, 31 August 2011
Author:reedy
Status:ok
Tags:
Comment:
Tidy up w/c

Remove trailing whitespace, add some documentation
Modified paths:
  • /trunk/phase3/includes/OutputPage.php (modified) (history)
  • /trunk/phase3/includes/Title.php (modified) (history)
  • /trunk/phase3/includes/WebRequest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/OutputPage.php
@@ -1895,7 +1895,7 @@
18961896 *
18971897 * showErrorPage( 'titlemsg', 'pagetextmsg', array( 'param1', 'param2' ) );
18981898 * showErrorPage( 'titlemsg', $messageObject );
1899 - *
 1899+ *
19001900 * @param $title String: message key for page title
19011901 * @param $msg Mixed: message key (string) for page text, or a Message object
19021902 * @param $params Array: message parameters; ignored if $msg is a Message object
@@ -3039,7 +3039,7 @@
30403040 ResourceLoaderModule::TYPE_STYLES
30413041 );
30423042 }
3043 -
 3043+
30443044 // Add stuff in $otherTags (previewed user CSS if applicable)
30453045 $ret .= $otherTags;
30463046 return $ret;
Index: trunk/phase3/includes/WebRequest.php
@@ -167,10 +167,16 @@
168168 return $proto . '://' . IP::combineHostAndPort( $host, $port, $stdPort );
169169 }
170170
 171+ /**
 172+ * @return array
 173+ */
171174 public static function detectProtocolAndStdPort() {
172175 return ( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] == 'on' ) ? array( 'https', 443 ) : array( 'http', 80 );
173176 }
174177
 178+ /**
 179+ * @return string
 180+ */
175181 public static function detectProtocol() {
176182 list( $proto, $stdPort ) = self::detectProtocolAndStdPort();
177183 return $proto;
@@ -603,7 +609,7 @@
604610 * Return the request URI with the canonical service and hostname, path,
605611 * and query string. This will be suitable for use as an absolute link
606612 * in HTML or other output.
607 - *
 613+ *
608614 * If $wgServer is protocol-relative, this will return a fully
609615 * qualified URL with the protocol that was used for this request.
610616 *
@@ -921,6 +927,10 @@
922928 * if there was no dot before the question mark (bug 28235).
923929 *
924930 * @deprecated Use checkUrlExtension().
 931+ *
 932+ * @param $extWhitelist array
 933+ *
 934+ * @return bool
925935 */
926936 public function isPathInfoBad( $extWhitelist = array() ) {
927937 global $wgScriptExtension;
@@ -1180,15 +1190,26 @@
11811191 throw new MWException( "{$method}() not implemented" );
11821192 }
11831193
 1194+ /**
 1195+ * @param $name string
 1196+ * @param $default string
 1197+ * @return string
 1198+ */
11841199 public function getText( $name, $default = '' ) {
11851200 # Override; don't recode since we're using internal data
11861201 return (string)$this->getVal( $name, $default );
11871202 }
11881203
 1204+ /**
 1205+ * @return Array
 1206+ */
11891207 public function getValues() {
11901208 return $this->data;
11911209 }
11921210
 1211+ /**
 1212+ * @return array
 1213+ */
11931214 public function getQueryValues() {
11941215 if ( $this->wasPosted ) {
11951216 return array();
@@ -1197,6 +1218,9 @@
11981219 }
11991220 }
12001221
 1222+ /**
 1223+ * @return bool
 1224+ */
12011225 public function wasPosted() {
12021226 return $this->wasPosted;
12031227 }
@@ -1209,10 +1233,18 @@
12101234 $this->notImplemented( __METHOD__ );
12111235 }
12121236
 1237+ /**
 1238+ * @param $name
 1239+ * @return bool|string
 1240+ */
12131241 public function getHeader( $name ) {
12141242 return isset( $this->headers[$name] ) ? $this->headers[$name] : false;
12151243 }
12161244
 1245+ /**
 1246+ * @param $name string
 1247+ * @param $val string
 1248+ */
12171249 public function setHeader( $name, $val ) {
12181250 $this->headers[$name] = $val;
12191251 }
@@ -1230,14 +1262,25 @@
12311263 return $this->session;
12321264 }
12331265
 1266+ /**
 1267+ * @param array $extWhitelist
 1268+ * @return bool
 1269+ */
12341270 public function isPathInfoBad( $extWhitelist = array() ) {
12351271 return false;
12361272 }
12371273
 1274+ /**
 1275+ * @param array $extWhitelist
 1276+ * @return bool
 1277+ */
12381278 public function checkUrlExtension( $extWhitelist = array() ) {
12391279 return true;
12401280 }
12411281
 1282+ /**
 1283+ * @return string
 1284+ */
12421285 protected function getRawIP() {
12431286 return '127.0.0.1';
12441287 }
Index: trunk/phase3/includes/Title.php
@@ -47,7 +47,6 @@
4848 */
4949 const GAID_FOR_UPDATE = 1;
5050
51 -
5251 /**
5352 * @name Private member variables
5453 * Please use the accessor functions instead.
@@ -759,7 +758,7 @@
760759
761760 /**
762761 * Return the prefixed title with spaces _without_ the interwiki prefix
763 - *
 762+ *
764763 * @return \type{\string} the title, prefixed by the namespace but not by the interwiki prefix, with spaces
765764 */
766765 public function getSemiPrefixedText() {
@@ -768,7 +767,7 @@
769768 $s = str_replace( '_', ' ', $s );
770769 $this->mSemiPrefixedText = $s;
771770 }
772 - return $this->mSemiPrefixedText;
 771+ return $this->mSemiPrefixedText;
773772 }
774773
775774 /**
@@ -999,7 +998,7 @@
1000999 public function escapeFullURL( $query = '' ) {
10011000 return htmlspecialchars( $this->getFullURL( $query ) );
10021001 }
1003 -
 1002+
10041003 /**
10051004 * HTML-escaped version of getCanonicalURL()
10061005 */
@@ -1011,7 +1010,7 @@
10121011 * Get the URL form for an internal link.
10131012 * - Used in various Squid-related code, in case we have a different
10141013 * internal hostname for the server from the exposed one.
1015 - *
 1014+ *
10161015 * This uses $wgInternalServer to qualify the path, or $wgServer
10171016 * if $wgInternalServer is not set. If the server variable used is
10181017 * protocol-relative, the URL will be expanded to http://
@@ -1036,9 +1035,9 @@
10371036 * Get the URL for a canonical link, for use in things like IRC and
10381037 * e-mail notifications. Uses $wgCanonicalServer and the
10391038 * GetCanonicalURL hook.
1040 - *
 1039+ *
10411040 * NOTE: Unlike getInternalURL(), the canonical URL includes the fragment
1042 - *
 1041+ *
10431042 * @param $query string An optional query string
10441043 * @param $variant string Language variant of URL (for sr, zh, ...)
10451044 * @return string The URL
@@ -3380,7 +3379,7 @@
33813380 array( 'rc_timestamp' => $rcts, 'rc_namespace' => $newns, 'rc_title' => $newdbk, 'rc_new' => 1 ),
33823381 __METHOD__
33833382 );
3384 -
 3383+
33853384 if ( $wgEnableInterwikiTemplatesTracking && $wgGlobalDatabase ) {
33863385 $dbw2 = wfGetDB( DB_MASTER, array(), $wgGlobalDatabase );
33873386 $dbw2->delete( 'globaltemplatelinks',

Status & tagging log