23use InvalidArgumentException;
45 parent::__construct(
'wgUser' );
88 self::$destructorDeprecationDisarmed =
true;
93 self::$destructorDeprecationDisarmed =
false;
106 return $globalUser->realUser;
107 } elseif ( $globalUser instanceof
User ) {
110 throw new InvalidArgumentException(
111 '$globalUser must be a User (or MediaWiki\StubObject\StubGlobalUser), got ' .
112 get_debug_type( $globalUser )
136 public function _unstub( $name =
'_unstub', $level = 2 ) {
137 if ( !$GLOBALS[$this->global] instanceof
self ) {
138 return $GLOBALS[$this->global];
142 wfDebug(
"Unstubbing \${$this->global} on call of "
143 .
"\${$this->global}::$name from $caller" );
144 $GLOBALS[$this->global] = $this->_newObject();
145 return $GLOBALS[$this->global];
149 if ( !self::$destructorDeprecationDisarmed ) {
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
wfGetCaller( $level=2)
Get the name of the function which called this function wfGetCaller( 1 ) is the function with the wfG...
wfDeprecatedMsg( $msg, $version=false, $component=false, $callerOffset=2)
Log a deprecation warning with arbitrary message text.
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Logs a warning that a deprecated feature was used.
if(!defined('MW_SETUP_CALLBACK'))