MediaWiki master
MediaWiki\Settings\Config\ConfigBuilderBase Class Reference

Inherits MediaWiki\Settings\Config\ConfigBuilder.

Inherited by MediaWiki\Settings\Config\ArrayConfigBuilder, and MediaWiki\Settings\Config\GlobalConfigBuilder.

Collaboration diagram for MediaWiki\Settings\Config\ConfigBuilderBase:

Public Member Functions

 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

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

 
- Public Member Functions inherited from MediaWiki\Settings\Config\ConfigBuilder
 build ()
 Build the resulting Config object.
 
 get (string $key)
 Get the current value for $key.
 

Protected Member Functions

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

Detailed Description

Definition at line 5 of file ConfigBuilderBase.php.

Member Function Documentation

◆ has()

MediaWiki\Settings\Config\ConfigBuilderBase::has ( string $key)
abstractprotected

◆ set()

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

Implements MediaWiki\Settings\Config\ConfigBuilder.

Definition at line 14 of file ConfigBuilderBase.php.

◆ setDefault()

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

Implements MediaWiki\Settings\Config\ConfigBuilder.

Definition at line 42 of file ConfigBuilderBase.php.

◆ setMulti()

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

Set all values in the array.

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

Implements MediaWiki\Settings\Config\ConfigBuilder.

Reimplemented in MediaWiki\Settings\Config\ArrayConfigBuilder, and MediaWiki\Settings\Config\GlobalConfigBuilder.

Definition at line 32 of file ConfigBuilderBase.php.

◆ setMultiDefault()

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

Implements MediaWiki\Settings\Config\ConfigBuilder.

Definition at line 65 of file ConfigBuilderBase.php.

◆ update()

MediaWiki\Settings\Config\ConfigBuilderBase::update ( string $key,
$value )
abstractprotected

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