Sets the default value.

@param string|string[]|null $default The default value

@throws LogicException When incorrect default value is given
542888
public function setDefault($default = null)
    {
        if (self::REQUIRED === $this->mode && null !== $default) {
            throw new LogicException('Cannot set a default value except for InputArgument::OPTIONAL mode.');
        }

        if ($this->isArray()) {
            if (null === $default) {
                $default = [];
            } elseif (!\is_array($default)) {
                throw new LogicException('A default value for an array argument must be an array.');
            }
        }

        $this->default = $default;
    }
953883
def set_default(self, default):  # type: (typing.Any) -> None
        
        if default is not None and len(default) > 1 and default[0] == '"' and default[-1] == '"':
            default = default[1:-1]
        self.defaultValue = default
132606
public function setDefaultArguments($default_settings)
    {
        foreach ($default_settings as $setting => $val) {
            if (property_exists(get_class(), $setting)) {
                $this->$setting = $val;
            }
        }
    }
7048
protected function _setDefaultOptions($options)
    {
        if (!is_array($options)) {
            Zend_Cache::throwException('default_options must be an array !');
        }
        foreach ($options as $key=>$value) {
            if (!is_string($key)) {
                Zend_Cache::throwException("invalid option [$key] !");
            }
            $key = strtolower($key);
            if (isset($this->_specificOptions['default_options'][$key])) {
                $this->_specificOptions['default_options'][$key] = $value;
            }
        }
    }
706012
protected function setDefaultOptions(array $options=[])
    {

        parent::setDefaultOptions($options);

        $this->defaultOptions['primary_key'] = $this->toModel->getKeyName();
    }
847358
public function getValueOrDefault($key, $default = null) {
        if (!empty($this->values[$key])) {
            return $this->values[$key];
        }
        elseif (!empty($this->defaults[$key])) {
            return $this->defaults[$key];
        }
        else {
            return $default;
        }
    }
650476
public function setDefaultValues(Array $defaultValues)
    {
        foreach ($defaultValues as $defaultName => $defaultValue) {
            if (array_key_exists($defaultName, $this->_metadata)) {
                $this->_defaultValues[$defaultName] = $defaultValue;
            }
        }
        return $this;
    }
14268
public function setDefaultValue($defaultValue)
    {
        if (!is_string($defaultValue)) {
            throw new \InvalidArgumentException('The attribute defaultValue on the class Attribute has to be string (' . gettype($defaultValue) . ('object' === gettype($defaultValue) ? ' ' . get_class($defaultValue) : '') . ' given).');
        }

        $this->defaultValue = $defaultValue;

        return $this;
    }
1222111
public function offsetSet($offset, $value) {
		if(is_null($offset))
			throw new \LogicException('Offset must not be null.');
		else
			$this->params[$offset] = $value;
	}
105956
public function setDefaultFont($default = null)
    {
        $old = $this->_defaultFont;
        $this->_defaultFont = $default;
        if ($default) $this->value['font-family'] = $default;
        return $old;
    }
1128318
public function setDefaultValue($defaultValue)
    {
        if (!$defaultValue instanceof ColumnDefaultValue) {
            $defaultValue = new ColumnDefaultValue($defaultValue, ColumnDefaultValue::TYPE_VALUE);
        }

        $this->domain->setDefaultValue($defaultValue);
    }
144545
public function setting($setting, $default = null)
    {
        $value = parent::setting($setting);
        if (null === $value) {
            $value = isset(static::$globalSettings[$setting]) ? static::$globalSettings[$setting] : $default;
        }

        return $value;
    }
161264
public function setDefaultValue($value = null)
    {
        if (! $this->value) {
            if ($value = $value ?: config("fields.values.{$this->key}")) {
                foreach ((array) $value as $locale => $translation) {
                    $locale = is_string($locale) ? $locale : $this->getDefaultLocale();
                    $this->setTranslation('value', $translation, $locale);
                    $this->addTranslated($locale);
                }
            }
        }
    }
1200981
public function configDefault($key, $default = null)
    {
        $value = $this->config($key);
        if ($value === null) {
            $this->config($key, $default);
        }
    }
740629
public function getDefaultValue()
    {
        if (!$this->hasDefaultValue) {
            throw new \LogicException(sprintf('Argument $%s does not have a default value. Use %s::hasDefaultValue() to avoid this exception.', $this->name, __CLASS__));
        }

        return $this->defaultValue;
    }
1255243
public function setDefault($default) : Value
    {
        if (isset($default) && !$this->mode->is(Value::OPTIONAL)) {
            throw new \InvalidArgumentException('Cannot set a default value for non-optional values.');
        }

        $this->default = $default;

        return $this;
    }
1252193
public function set($key, $value = null)
    {
        if ($value === null) {
            $this->defaultValues = $key + $this->defaultValues;
        } else {
            $this->defaultValues[$key] = $value;
        }

        return $this;
    }