From 025f03ec88866a3fd6a860b81343e4f313fb8ab0 Mon Sep 17 00:00:00 2001 From: jeroendedauw Date: Thu, 9 Aug 2012 14:29:46 +0200 Subject: [PATCH] Added missing @since and @return tags so other people dont have to waste their time figuring it out as well Change-Id: I84e75da7bdbf30b57368eca0051b1aa664afc798 --- includes/parser/Parser.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 66da408872..b3512908bd 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -735,16 +735,22 @@ class Parser { /** * Get the target language for the content being parsed. This is usually the * language that the content is in. + * + * @since 1.19 + * + * @return Language|null */ - function getTargetLanguage() { + public function getTargetLanguage() { $target = $this->mOptions->getTargetLanguage(); + if ( $target !== null ) { return $target; } elseif( $this->mOptions->getInterfaceMessage() ) { return $this->mOptions->getUserLangObj(); } elseif( is_null( $this->mTitle ) ) { - throw new MWException( __METHOD__.': $this->mTitle is null' ); + throw new MWException( __METHOD__ . ': $this->mTitle is null' ); } + return $this->mTitle->getPageLanguage(); } -- 2.20.1