X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FStubObject.php;h=fb9b3e455cb93ac8abf692eeccb7e0f6ad04bd6a;hb=1f9ca54b6f3eca77bdf1b4af686f42c5035275ca;hp=6508bceca7a6f44b010daaab7c8662d088b50745;hpb=c888520e9921225b92af101f21ae3462530e3e35;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/StubObject.php b/includes/StubObject.php index 6508bceca7..fb9b3e455c 100644 --- a/includes/StubObject.php +++ b/includes/StubObject.php @@ -83,9 +83,9 @@ class StubObject { * @param object $obj Object to check. * @return void */ - static function unstub( $obj ) { + static function unstub( &$obj ) { if ( $obj instanceof StubObject ) { - $obj->_unstub( 'unstub', 3 ); + $obj = $obj->_unstub( 'unstub', 3 ); } } @@ -134,6 +134,7 @@ class StubObject { * @param string $name Name of the method called in this object. * @param int $level Level to go in the stack trace to get the function * who called this function. + * @return The unstubbed version of itself * @throws MWException */ function _unstub( $name = '_unstub', $level = 2 ) { @@ -157,6 +158,7 @@ class StubObject { $GLOBALS[$this->global] = $this->_newObject(); --$recursionLevel; wfProfileOut( $fname ); + return $GLOBALS[$this->global]; } } }