7 abstract protected function has(
string $key ): bool;
13 abstract protected function update(
string $key, $value );
23 if ( $mergeStrategy && $this->
has( $key ) && is_array( $newValue ) ) {
24 $oldValue = $this->
get( $key );
25 if ( $oldValue && is_array( $oldValue ) ) {
26 $newValue = $mergeStrategy->merge( $oldValue, $newValue );
29 $this->
update( $key, $newValue );
37 foreach ( $values as $key => $value ) {
38 $this->
set( $key, $value, $mergeStrategies[$key] ?? null );
51 if ( $this->has( $key ) ) {
52 if ( $mergeStrategy && $defaultValue && is_array( $defaultValue ) ) {
53 $customValue = $this->
get( $key );
54 if ( is_array( $customValue ) ) {
55 $newValue = $mergeStrategy->merge( $defaultValue, $customValue );
56 $this->update( $key, $newValue );
60 $this->update( $key, $defaultValue );
70 foreach ( $defaults as $key => $defaultValue ) {
71 $this->setDefault( $key, $defaultValue, $mergeStrategies[$key] ??
null );
if(!defined('MW_SETUP_CALLBACK'))