public function imposeDefault($settings = [])
    {
        foreach ($settings as $name => $value) {
            $name = strtolower(str_replace('-', '', $name));
            if (!isset($this->{$name})) {
                if (is_scalar($value)) {
                    $this->{$name} = new Generic($value);
                } else {
                    $this->{$name} = $value;
                }
            } elseif ($value instanceof Section) {
                $value->imposeDefault($value);
            } else {
                $current = $this->{$name};
                if (!is_object($value)) {
                    $this->{$name} = new Generic($value);
                } else {
                    $this->{$name} = $value;
                }
                $this->{$name}->setHumanValue($current->value);
                $this->{$name}->source = $current->source;
                $this->{$name}->revision = $current->revision;
            }
        }
    }
public function imposeDefault($settings = [])
    {
        foreach ($settings as $name => $value) {
            $name = strtolower(str_replace('-', '', $name));
            if (!isset($this->{$name})) {
                if (is_scalar($value)) {
                    $this->{$name} = new Generic($value);
                } else {
                    $this->{$name} = $value;
                }
            } elseif ($value instanceof Section) {
                $value->imposeDefault($value);
            } else {
                $current = $this->{$name};
                if (!is_object($value)) {
                    $this->{$name} = new Generic($value);
                } else {
                    $this->{$name} = $value;
                }
                $this->{$name}->setHumanValue($current->value);
                $this->{$name}->source = $current->source;
                $this->{$name}->revision = $current->revision;
            }
        }
    }
public function imposeDefault ( $ settings = [ ] ) { foreach ( $ settings as $ name => $ value ) { $ name = strtolower ( str_replace ( '-' , '' , $ name ) ) ; if ( ! isset ( $ this -> { $ name } ) ) { if ( is_scalar ( $ value ) ) { $ this -> { $ name } = new Generic ( $ value ) ; } else { $ this -> { $ name } = $ value ; } } elseif ( $ value instanceof Section ) { $ value -> imposeDefault ( $ value ) ; } else { $ current = $ this -> { $ name } ; if ( ! is_object ( $ value ) ) { $ this -> { $ name } = new Generic ( $ value ) ; } else { $ this -> { $ name } = $ value ; } $ this -> { $ name } -> setHumanValue ( $ current -> value ) ; $ this -> { $ name } -> source = $ current -> source ; $ this -> { $ name } -> revision = $ current -> revision ; } } }
Impose default config
@param array {"setting": "value"}
@return void
Impose default config