Index: trunk/phase3/includes/Message.php |
— | — | @@ -104,9 +104,7 @@ |
105 | 105 | */ |
106 | 106 | public function __construct( $key, $params = array() ) { |
107 | 107 | $this->key = $key; |
108 | | - foreach( $params as $param ){ |
109 | | - $this->params( $param ); |
110 | | - } |
| 108 | + $this->parameters = array_values( $params ); |
111 | 109 | } |
112 | 110 | |
113 | 111 | /** |
— | — | @@ -118,16 +116,16 @@ |
119 | 117 | * @return Message: $this |
120 | 118 | */ |
121 | 119 | public static function key( $key ) { |
122 | | - return new Message( $key ); |
| 120 | + return new self( $key ); |
123 | 121 | } |
124 | 122 | |
125 | 123 | /** |
126 | 124 | * Adds parameters to the parameter list of this message. |
127 | | - * @param Vargars: parameters as Strings |
| 125 | + * @param Varargs: parameters as Strings |
128 | 126 | * @return Message: $this |
129 | 127 | */ |
130 | 128 | public function params( /*...*/ ) { |
131 | | - $this->parameters += array_values( func_get_args() ); |
| 129 | + $this->parameters = array_merge( $this->parameters, array_values( func_get_args() ) ); |
132 | 130 | return $this; |
133 | 131 | } |
134 | 132 | |
— | — | @@ -141,8 +139,8 @@ |
142 | 140 | */ |
143 | 141 | public function rawParams( /*...*/ ) { |
144 | 142 | $params = func_get_args(); |
145 | | - foreach( $params as $param ){ |
146 | | - $this->parameters[] = array( 'raw' => $param ); |
| 143 | + foreach( $params as $param ) { |
| 144 | + $this->parameters[] = array( 'raw' => $param ); |
147 | 145 | } |
148 | 146 | return $this; |
149 | 147 | } |
— | — | @@ -151,7 +149,7 @@ |
152 | 150 | * Request the message in any language that is supported. |
153 | 151 | * As a side effect interface message status is unconditionally |
154 | 152 | * turned off. |
155 | | - * @param $lang Mixed: langauge code or language object. |
| 153 | + * @param $lang Mixed: language code or Language object. |
156 | 154 | * @return Message: $this |
157 | 155 | */ |
158 | 156 | public function language( $lang ) { |
— | — | @@ -232,9 +230,9 @@ |
233 | 231 | * Fully parse the text from wikitext to HTML |
234 | 232 | * @return String parsed HTML |
235 | 233 | */ |
236 | | - public function parse(){ |
| 234 | + public function parse() { |
237 | 235 | $this->format = 'parse'; |
238 | | - return $this->tostring(); |
| 236 | + return $this->toString(); |
239 | 237 | } |
240 | 238 | |
241 | 239 | /** |
— | — | @@ -243,7 +241,7 @@ |
244 | 242 | */ |
245 | 243 | public function text() { |
246 | 244 | $this->format = 'text'; |
247 | | - return $this->tostring(); |
| 245 | + return $this->toString(); |
248 | 246 | } |
249 | 247 | |
250 | 248 | /** |
— | — | @@ -252,7 +250,7 @@ |
253 | 251 | */ |
254 | 252 | public function plain() { |
255 | 253 | $this->format = 'plain'; |
256 | | - return $this->tostring(); |
| 254 | + return $this->toString(); |
257 | 255 | } |
258 | 256 | |
259 | 257 | /** |
— | — | @@ -261,7 +259,7 @@ |
262 | 260 | */ |
263 | 261 | public function parseAsBlock() { |
264 | 262 | $this->format = 'block-parse'; |
265 | | - return $this->tostring(); |
| 263 | + return $this->toString(); |
266 | 264 | } |
267 | 265 | |
268 | 266 | /** |
— | — | @@ -271,7 +269,7 @@ |
272 | 270 | */ |
273 | 271 | public function escaped() { |
274 | 272 | $this->format = 'escaped'; |
275 | | - return $this->tostring(); |
| 273 | + return $this->toString(); |
276 | 274 | } |
277 | 275 | |
278 | 276 | /** |