Index: trunk/phase3/includes/Message.php |
— | — | @@ -256,12 +256,6 @@ |
257 | 257 | |
258 | 258 | /** |
259 | 259 | * Returns the message parsed from wikitext to HTML. |
260 | | - * TODO: in PHP >= 5.2.0, we can make this a magic method, |
261 | | - * and then we can do, eg: |
262 | | - * $foo = Message::get($key); |
263 | | - * $string = "<abbr>$foo</abbr>"; |
264 | | - * But we shouldn't implement that while MediaWiki still supports |
265 | | - * PHP < 5.2; or people will start using it... |
266 | 260 | * @return String: HTML |
267 | 261 | */ |
268 | 262 | public function toString() { |
— | — | @@ -292,6 +286,16 @@ |
293 | 287 | |
294 | 288 | return $string; |
295 | 289 | } |
| 290 | + |
| 291 | + /** |
| 292 | + * Magic method implementation of the above (for PHP >= 5.2.0), so we can do, eg: |
| 293 | + * $foo = Message::get($key); |
| 294 | + * $string = "<abbr>$foo</abbr>"; |
| 295 | + * @return String |
| 296 | + */ |
| 297 | + public function __toString() { |
| 298 | + return $this->toString(); |
| 299 | + } |
296 | 300 | |
297 | 301 | /** |
298 | 302 | * Fully parse the text from wikitext to HTML |