From: Roan Kattouw Date: Thu, 28 Aug 2008 14:19:01 +0000 (+0000) Subject: Improve FakeTitle implementation: X-Git-Tag: 1.31.0-rc.0~45593 X-Git-Url: https://git.heureux-cyclage.org/?a=commitdiff_plain;h=774baf349ab4ee304911fc575e5c7e31baf2f4eb;p=lhc%2Fweb%2Fwiklou.git 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 --- diff --git a/includes/FakeTitle.php b/includes/FakeTitle.php index 4c2eddc8c4..8dbfe3ded2 100644 --- a/includes/FakeTitle.php +++ b/includes/FakeTitle.php @@ -3,15 +3,13 @@ /** * Fake title class that triggers an error if any members are called */ -class FakeTitle { +class FakeTitle extends Title { function error() { throw new MWException( "Attempt to call member function of FakeTitle\n" ); } // PHP 5.1 method overload function __call( $name, $args ) { $this->error(); } // PHP <5.1 compatibility - function getInterwikiLink() { $this->error(); } - function getInterwikiCached() { $this->error(); } function isLocal() { $this->error(); } function isTrans() { $this->error(); } function getText() { $this->error(); }