r40146 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40145‎ | r40146 | r40147 >
Date:14:19, 28 August 2008
Author:catrope
Status:old
Tags:
Comment:
Improve FakeTitle implementation:
* Make FakeTitle a subclass of Title so functions with a type hint like Parser::parse() accept FakeTitles too
* Remove two static functions from the FakeTitle class
Modified paths:
  • /trunk/phase3/includes/FakeTitle.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/FakeTitle.php
@@ -3,15 +3,13 @@
44 /**
55 * Fake title class that triggers an error if any members are called
66 */
7 -class FakeTitle {
 7+class FakeTitle extends Title {
88 function error() { throw new MWException( "Attempt to call member function of FakeTitle\n" ); }
99
1010 // PHP 5.1 method overload
1111 function __call( $name, $args ) { $this->error(); }
1212
1313 // PHP <5.1 compatibility
14 - function getInterwikiLink() { $this->error(); }
15 - function getInterwikiCached() { $this->error(); }
1614 function isLocal() { $this->error(); }
1715 function isTrans() { $this->error(); }
1816 function getText() { $this->error(); }