MediaWiki REL1_40
MediaWiki\Settings\Config\ArrayConfigBuilder Class Reference

Inherits MediaWiki\Settings\Config\ConfigBuilderBase.

Collaboration diagram for MediaWiki\Settings\Config\ArrayConfigBuilder:

Public Member Functions

 build ()
 Build the configuration.
 
 get (string $key)
 Get the current value for $key.
 
 setMulti (array $values, array $mergeStrategies=[])
 Set all values in the array.
Parameters
array$values
MergeStrategy[]$mergeStrategiesThe merge strategies indexed by config key
Returns
ConfigBuilder

 
 setMultiDefault ( $defaults, $mergeStrategies)
 
- Public Member Functions inherited from MediaWiki\Settings\Config\ConfigBuilderBase
 set (string $key, $newValue, MergeStrategy $mergeStrategy=null)
 Set the configuration $key to $value.
Parameters
string$key
mixed$value
MergeStrategy | null$mergeStrategystrategy for merging array config values.
Returns
ConfigBuilder

 
 setDefault (string $key, $defaultValue, MergeStrategy $mergeStrategy=null)
 Set the default for the configuration $key to $defaultValue.If the $key is already set, non-array $defaultValue will be ignored, for array $defaultValue the existing value will be merged into it as if the default was already there when the existing value was set.
Parameters
string$key
mixed$defaultValue
MergeStrategy | null$mergeStrategystrategy for merging array config values.
Returns
ConfigBuilder

 
 setMultiDefault (array $defaults, array $mergeStrategies)
 Set defaults in a batch.
Parameters
array$defaultsThe default values
MergeStrategy[]$mergeStrategiesThe merge strategies indexed by config key
Returns
ConfigBuilder
Exceptions
SettingsBuilderExceptionif a merge strategy is not provided and the value is not an array.

 

Protected Member Functions

 has (string $key)
 
 update (string $key, $value)
 

Protected Attributes

array $config = []
 

Detailed Description

Definition at line 9 of file ArrayConfigBuilder.php.

Member Function Documentation

◆ build()

MediaWiki\Settings\Config\ArrayConfigBuilder::build ( )

Build the configuration.

Returns
IterableConfig

Implements MediaWiki\Settings\Config\ConfigBuilder.

Definition at line 54 of file ArrayConfigBuilder.php.

◆ get()

MediaWiki\Settings\Config\ArrayConfigBuilder::get ( string $key)

Get the current value for $key.

Parameters
string$key
Returns
mixed

Implements MediaWiki\Settings\Config\ConfigBuilder.

Definition at line 18 of file ArrayConfigBuilder.php.

◆ has()

MediaWiki\Settings\Config\ArrayConfigBuilder::has ( string $key)
protected

Reimplemented from MediaWiki\Settings\Config\ConfigBuilderBase.

Definition at line 14 of file ArrayConfigBuilder.php.

◆ setMulti()

MediaWiki\Settings\Config\ArrayConfigBuilder::setMulti ( array $values,
array $mergeStrategies = [] )

Set all values in the array.

Parameters
array$values
MergeStrategy[]$mergeStrategiesThe merge strategies indexed by config key
Returns
ConfigBuilder

Reimplemented from MediaWiki\Settings\Config\ConfigBuilderBase.

Definition at line 26 of file ArrayConfigBuilder.php.

◆ setMultiDefault()

MediaWiki\Settings\Config\ArrayConfigBuilder::setMultiDefault ( $defaults,
$mergeStrategies )

Definition at line 58 of file ArrayConfigBuilder.php.

◆ update()

MediaWiki\Settings\Config\ArrayConfigBuilder::update ( string $key,
$value )
protected

Reimplemented from MediaWiki\Settings\Config\ConfigBuilderBase.

Definition at line 22 of file ArrayConfigBuilder.php.

Member Data Documentation

◆ $config

array MediaWiki\Settings\Config\ArrayConfigBuilder::$config = []
protected

Definition at line 12 of file ArrayConfigBuilder.php.


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