23use InvalidArgumentException;
48 parent::__construct(
'wgUser' );
90 self::$destructorDeprecationDisarmed =
true;
95 self::$destructorDeprecationDisarmed =
false;
108 return $globalUser->realUser;
109 } elseif ( $globalUser instanceof
User ) {
112 throw new InvalidArgumentException(
113 '$globalUser must be a User (or MediaWiki\StubObject\StubGlobalUser), got ' .
114 ( is_object( $globalUser ) ? get_class( $globalUser ) : gettype( $globalUser ) )
138 public function _unstub( $name =
'_unstub', $level = 2 ) {
139 if ( !$GLOBALS[$this->global] instanceof
self ) {
140 return $GLOBALS[$this->global];
144 wfDebug(
"Unstubbing \${$this->global} on call of "
145 .
"\${$this->global}::$name from $caller" );
146 $GLOBALS[$this->global] = $this->_newObject();
147 return $GLOBALS[$this->global];
151 if ( !self::$destructorDeprecationDisarmed ) {
160class_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'))