23use InvalidArgumentException;
48 parent::__construct(
'wgUser' );
91 self::$destructorDeprecationDisarmed =
true;
96 self::$destructorDeprecationDisarmed =
false;
109 return $globalUser->realUser;
110 } elseif ( $globalUser instanceof
User ) {
113 throw new InvalidArgumentException(
114 '$globalUser must be a User (or MediaWiki\StubObject\StubGlobalUser), got ' .
115 get_debug_type( $globalUser )
139 public function _unstub( $name =
'_unstub', $level = 2 ) {
140 if ( !$GLOBALS[$this->global] instanceof
self ) {
141 return $GLOBALS[$this->global];
145 wfDebug(
"Unstubbing \${$this->global} on call of "
146 .
"\${$this->global}::$name from $caller" );
147 $GLOBALS[$this->global] = $this->_newObject();
148 return $GLOBALS[$this->global];
152 if ( !self::$destructorDeprecationDisarmed ) {
159class_alias( StubGlobalUser::class,
'StubGlobalUser' );
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'))