MediaWiki REL1_39
MediaWiki\Settings\Config\ArrayConfigBuilder Class Reference
Inheritance diagram for MediaWiki\Settings\Config\ArrayConfigBuilder:
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 10 of file ArrayConfigBuilder.php.

Member Function Documentation

◆ build()

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

Build the configuration.

Todo
Once we can use PHP 7.4, change the return type declaration to IterableConfig.
Returns
IterableConfig

Implements MediaWiki\Settings\Config\ConfigBuilder.

Definition at line 56 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 19 of file ArrayConfigBuilder.php.

◆ has()

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

Reimplemented from MediaWiki\Settings\Config\ConfigBuilderBase.

Definition at line 15 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 27 of file ArrayConfigBuilder.php.

◆ setMultiDefault()

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

Definition at line 60 of file ArrayConfigBuilder.php.

◆ update()

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

Reimplemented from MediaWiki\Settings\Config\ConfigBuilderBase.

Definition at line 23 of file ArrayConfigBuilder.php.

Member Data Documentation

◆ $config

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

Definition at line 13 of file ArrayConfigBuilder.php.


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