X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FStubObject.php;h=795b5d65bed6fa607e82b41aa438f17cb11e8ab1;hb=557a05f3843c486e79e01da32c1baa397a352c9a;hp=78f9f6410da5b5ffc3068e7257d1d8d7504340e5;hpb=94c04f7cd19136ed05c351d046155b4367899adb;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/StubObject.php b/includes/StubObject.php index 78f9f6410d..795b5d65be 100644 --- a/includes/StubObject.php +++ b/includes/StubObject.php @@ -52,6 +52,7 @@ class StubObject { * * @param $name String: name of the function called * @param $args Array: arguments + * @return mixed */ function _call( $name, $args ) { $this->_unstub( $name, 5 ); @@ -60,6 +61,7 @@ class StubObject { /** * Create a new object to replace this stub object. + * @return object */ function _newObject() { return MWFunction::newObj( $this->mClass, $this->mParams ); @@ -71,6 +73,7 @@ class StubObject { * * @param $name String: name of the function called * @param $args Array: arguments + * @return mixed */ function __call( $name, $args ) { return $this->_call( $name, $args ); @@ -89,9 +92,10 @@ class StubObject { function _unstub( $name = '_unstub', $level = 2 ) { static $recursionLevel = 0; - if ( !($GLOBALS[$this->mGlobal] instanceof StubObject) ) + if ( !($GLOBALS[$this->mGlobal] instanceof StubObject) ) { return $GLOBALS[$this->mGlobal]; // already unstubbed. - + } + if ( get_class( $GLOBALS[$this->mGlobal] ) != $this->mClass ) { $fname = __METHOD__.'-'.$this->mGlobal; wfProfileIn( $fname ); @@ -116,6 +120,7 @@ class StubObject { class StubContLang extends StubObject { function __construct() { + wfDeprecated( __CLASS__, '1.18' ); parent::__construct( 'wgContLang' ); } @@ -123,6 +128,9 @@ class StubContLang extends StubObject { return $this->_call( $name, $args ); } + /** + * @return Language + */ function _newObject() { global $wgLanguageCode; $obj = Language::factory( $wgLanguageCode ); @@ -147,7 +155,10 @@ class StubUserLang extends StubObject { return $this->_call( $name, $args ); } + /** + * @return Language + */ function _newObject() { - return RequestContext::getMain()->lang; + return RequestContext::getMain()->getLanguage(); } }