MediaWiki  master
MediaWiki\Settings\Config\ConfigBuilder Interface Reference

Builder for Config objects. More...

Inheritance diagram for MediaWiki\Settings\Config\ConfigBuilder:

Public Member Functions

 build ()
 Build the resulting Config object. More...
 
 set (string $key, $value, MergeStrategy $mergeStrategy=null)
 Set the configuration $key to $value. More...
 
 setDefault (string $key, $defaultValue, MergeStrategy $mergeStrategy=null)
 Set the default for the configuration $key to $defaultValue. More...
 
 setMulti (array $values, array $mergeStrategies=[])
 Set all values in the array. More...
 
 setMultiDefault (array $defaults, array $mergeStrategies)
 Set defaults in a batch. More...
 

Detailed Description

Builder for Config objects.

Stability: unstable

Definition at line 13 of file ConfigBuilder.php.

Member Function Documentation

◆ build()

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

◆ set()

MediaWiki\Settings\Config\ConfigBuilder::set ( string  $key,
  $value,
MergeStrategy  $mergeStrategy = null 
)

Set the configuration $key to $value.

Parameters
string$key
mixed$value
MergeStrategy | null$mergeStrategystrategy for merging array config values.
Returns
ConfigBuilder

Implemented in MediaWiki\Settings\Config\ConfigBuilderBase.

◆ setDefault()

MediaWiki\Settings\Config\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

Implemented in MediaWiki\Settings\Config\ConfigBuilderBase.

◆ setMulti()

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

Set all values in the array.

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

Implemented in MediaWiki\Settings\Config\GlobalConfigBuilder, MediaWiki\Settings\Config\ConfigBuilderBase, and MediaWiki\Settings\Config\ArrayConfigBuilder.

◆ setMultiDefault()

MediaWiki\Settings\Config\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.

Implemented in MediaWiki\Settings\Config\ConfigBuilderBase.


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