r64183 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64182‎ | r64183 | r64184 >
Date:20:52, 25 March 2010
Author:happy-melon
Status:ok
Tags:
Comment:
Various tweaks and fixes.
Modified paths:
  • /trunk/phase3/includes/Message.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Message.php
@@ -94,16 +94,16 @@
9595 /**
9696 * Constructor.
9797 * @param $key String: message key
 98+ * @param $params Array message parameters
 99+ * @param $options Array message options
98100 * @return Message: $this
99101 */
100102 public function __construct( $key, $params=array(), $options=array() ) {
101103 $this->key = $key;
102 - if( $params ){
103 - $this->params( $params );
 104+ foreach( $params as $param ){
 105+ $this->params( $param );
104106 }
105 - if( $options ){
106 - $this->options( $options );
107 - }
 107+ $this->options( $options );
108108 }
109109
110110 /**
@@ -173,7 +173,7 @@
174174 $this->language = Language::factory( $lang );
175175 } else {
176176 $type = gettype( $lang );
177 - throw new MWException( "Message::langauge() must be "
 177+ throw new MWException( __METHOD__ . " must be "
178178 . "passed a String or Language object; $type given"
179179 );
180180 }
@@ -238,8 +238,6 @@
239239 return $string;
240240 }
241241
242 - public function __tostring(){ return $this->toString(); }
243 -
244242 /**
245243 * Fully parse the text from wikitext to HTML
246244 * @return String parsed HTML
@@ -285,7 +283,7 @@
286284 public function parseAsBlock() {
287285 $this->options( array(
288286 'parse' => true,
289 - 'inline' => true,
 287+ 'inline' => false,
290288 ));
291289 return $this->tostring();
292290 }

Status & tagging log