MediaWiki master
MediaWiki\Debug\DeprecatablePropertyArray Class Reference

ArrayAccess with support for deprecating access to certain offsets. 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 with support for deprecating access to certain offsets.

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'.

Setting properties does not emit deprecation warnings.
Stability: newable

Definition at line 18 of file DeprecatablePropertyArray.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Debug\DeprecatablePropertyArray::__construct ( array $initializer,
array $deprecatedProperties,
string $name,
string $component = null )
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 39 of file DeprecatablePropertyArray.php.

Member Function Documentation

◆ offsetExists()

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

Definition at line 51 of file DeprecatablePropertyArray.php.

◆ offsetGet()

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

Definition at line 57 of file DeprecatablePropertyArray.php.

◆ offsetSet()

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

Definition at line 66 of file DeprecatablePropertyArray.php.

◆ offsetUnset()

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

Definition at line 74 of file DeprecatablePropertyArray.php.

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