MediaWiki REL1_40
MediaWiki\Debug\DeprecatablePropertyArray Class Reference

ArrayAccess implementation that supports deprecating access to certain properties. More...

Inherits ArrayAccess.

Collaboration diagram for MediaWiki\Debug\DeprecatablePropertyArray:

Public Member Functions

 __construct (array $initializer, array $deprecatedProperties, string $name, string $component=null)
 
 offsetExists ( $offset)
 
 offsetGet ( $offset)
 
 offsetSet ( $offset, $value)
 
 offsetUnset ( $offset)
 

Detailed Description

ArrayAccess implementation that supports deprecating access to certain properties.

It behaves mostly as a normal array, however in order to avoid instantiating deprecated properties by default, a callable initializer can be set to the property. It will be executed upon 'get'.

Note
setting properties does not emit deprecation warnings.
Stability: newable
Since
1.35

Definition at line 16 of file DeprecatablePropertyArray.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Debug\DeprecatablePropertyArray::__construct ( array $initializer,
array $deprecatedProperties,
string $name,
string $component = null )
Parameters
array$initializerInitial value of the array.
array$deprecatedPropertiesMap of deprecated property names to versions.
string$nameDescriptive identifier for the array
string | null$componentComponent to which array belongs. If not provided, assumed to be MW Core

Definition at line 37 of file DeprecatablePropertyArray.php.

Member Function Documentation

◆ offsetExists()

MediaWiki\Debug\DeprecatablePropertyArray::offsetExists ( $offset)

Definition at line 49 of file DeprecatablePropertyArray.php.

◆ offsetGet()

MediaWiki\Debug\DeprecatablePropertyArray::offsetGet ( $offset)

Definition at line 55 of file DeprecatablePropertyArray.php.

◆ offsetSet()

MediaWiki\Debug\DeprecatablePropertyArray::offsetSet ( $offset,
$value )

Definition at line 64 of file DeprecatablePropertyArray.php.

◆ offsetUnset()

MediaWiki\Debug\DeprecatablePropertyArray::offsetUnset ( $offset)

Definition at line 72 of file DeprecatablePropertyArray.php.


The documentation for this class was generated from the following file: