MediaWiki
master
DeprecatedGlobal.php
Go to the documentation of this file.
1
<?php
23
namespace
MediaWiki\StubObject
;
24
29
class
DeprecatedGlobal
extends
StubObject
{
31
protected
$version
;
32
38
public
function
__construct
( $name, $callback,
$version
=
false
) {
39
parent::__construct( $name, $callback );
40
$this->version =
$version
;
41
}
42
43
// phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore
44
public
function
_newObject
() {
45
/*
46
* Put the caller offset for wfDeprecated as 6, as
47
* that gives the function that uses this object, since:
48
*
49
* 1 = this function ( _newObject )
50
* 2 = MediaWiki\StubObject\StubObject::_unstub
51
* 3 = MediaWiki\StubObject\StubObject::_call
52
* 4 = MediaWiki\StubObject\StubObject::__call
53
* 5 = MediaWiki\StubObject\DeprecatedGlobal::<method of global called>
54
* 6 = Actual function using the global.
55
* (the same applies to _get/__get or _set/__set instead of _call/__call)
56
*
57
* Of course its theoretically possible to have other call
58
* sequences for this method, but that seems to be
59
* rather unlikely.
60
*/
61
wfDeprecated
(
'$'
. $this->global, $this->version,
false
, 6 );
62
return
parent::_newObject();
63
}
64
}
wfDeprecated
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Logs a warning that a deprecated feature was used.
Definition
GlobalFunctions.php:773
MediaWiki\StubObject\DeprecatedGlobal
Class to allow throwing wfDeprecated warnings when people use globals that we do not want them to.
Definition
DeprecatedGlobal.php:29
MediaWiki\StubObject\DeprecatedGlobal\$version
string false $version
Definition
DeprecatedGlobal.php:31
MediaWiki\StubObject\DeprecatedGlobal\__construct
__construct( $name, $callback, $version=false)
Definition
DeprecatedGlobal.php:38
MediaWiki\StubObject\DeprecatedGlobal\_newObject
_newObject()
Create a new object to replace this stub object.
Definition
DeprecatedGlobal.php:44
MediaWiki\StubObject\StubObject
Class to implement stub globals, which are globals that delay loading the their associated module cod...
Definition
StubObject.php:55
MediaWiki\StubObject
Definition
DeprecatedGlobal.php:23
includes
StubObject
DeprecatedGlobal.php
Generated on Tue Apr 22 2025 22:27:44 for MediaWiki by
1.10.0