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