@param mixed $initialValue

@return OptionValueBag
195586
protected function createOptionValueBag($initialValue)
    {
        $result = new OptionValueBag();
        if (null !== $initialValue) {
            $result->add($initialValue);
        }

        return $result;
    }
446855
@Override
	protected String initValuesImpl(final FieldCase ca) {
		String keyValue = keyConstraint.initValues(ca);
		selectedConstraint = map.get(keyValue);
		if (selectedConstraint == null) {
			selectedConstraint = map.get(DEFAULT_KEY);
		}
		if (selectedConstraint != null) {
			return selectedConstraint.initValues(ca);
		}
		return null;
	}
1204472
public function setDefaultValue($defaultValue): FieldInterface
    {
        if (!is_array($defaultValue)) {
            throw new \InvalidArgumentException(
                "The default value for instances of ".
                __CLASS__." must be an array"
            );
        }

        $this->defaultValue = $defaultValue;
        return $this;
    }
1169742
public function get($keyName, $defaultValue = null)
    {
        $this->initList();
        $keyName = strtolower($keyName);
        if (empty($this->list[$keyName])) {
            return $defaultValue;
        }
        return $this->list[$keyName];
    }
816794
public function setInitialValue($initialValue)
    {
        if (!is_int($initialValue) || ($initialValue <= 0)) {
            throw SchemaException::invalidSequenceInitialValue($this->getName());
        }

        $this->initialValue = $initialValue;
    }
1212494
public function get($itemName, $defaultValue = null)
    {
        $contents = $this->composeContents();
        $value = isset($contents[$itemName]) ? $contents[$itemName] : $defaultValue;

        return IniParser::i()->castItemValueToProperType($value);
    }
935098
public function get($param, $defaultValue = null)
    {
        return array_key_exists($param, $this->config) ? $this->config[$param] : $defaultValue;
    }
1297793
public static function assembleParamValue($value, $operator, $defaultValue = ':default:')
    {
        if (is_array($value) || is_object($value)) {
            $id = self::findIdFromObjectArray($value, $operator);

            if ($id !== null) {
                return self::prependOperator($id, $operator);
            }

            if (is_object($value)) {
                return $defaultValue;
            }
        }

        return self::prependOperator($value, $operator);
    }
290760
public ConfigOptionBuilder setDefaultWith( Object defaultValue ) {
        co.setHasDefault( true );
        co.setValue( defaultValue );
        return setOptional();
    }
871204
public static function fromString($headerValue)
    {
        $index = 0;

        $parts = HeaderUtils::split((string) $headerValue, ',;=');

        return new self(array_map(function ($subParts) use (&$index) {
            $part = array_shift($subParts);
            $attributes = HeaderUtils::combine($subParts);

            $item = new AcceptHeaderItem($part[0], $attributes);
            $item->setIndex($index++);

            return $item;
        }, $parts));
    }
236923
public function addConfigValue(\VinceT\AdminConfigurationBundle\Entity\ConfigValue $configValue)
    {
        $this->configValues[] = $configValue;

        return $this;
    }
1070767
protected function getConfigArrayOption($optionName, $defaultValue = null)
    {
        if (!isset($this->config[$optionName])) {
            return $defaultValue;
        }

        return $this->config[$optionName];
    }
392059
protected function createValueFromInput($inputValue)
    {
        if (is_array($inputValue)) {
            foreach ($inputValue as $inputValueItem) {
                if (!$inputValueItem instanceof Tag) {
                    return $inputValue;
                }
            }

            $inputValue = new Value($inputValue);
        }

        return $inputValue;
    }
159385
protected function option($name, $defaultValue = null)
    {
        $value = $this->getInput()->getOption($name);

        if (null === $value) {
            return $defaultValue;
        }

        return $value;
    }
393715
protected function getValue($rawValue, $defaultValue = null)
    {
        if ($rawValue === null) {
            return $defaultValue;
        }

        try {
            return (new Resource($rawValue))->process();
        } catch (Exception $e) {
            // ...
        }
    }
484724
public function getOption($optionName, $defaultValue = null)
    {
        $option = $this->optionManager->findOneByOptionName($optionName);

        return $option ?: $defaultValue;
    }
1256199
public function setOptionValue($optionName, $optionValue, array $values = [])
    {
        if (!isset($this->options[$optionName])) {
            $this->options[$optionName] = [
                'value' => $optionValue,
                'values' => $values,
            ];
        } elseif (!empty($this->options[$optionName]['values']) && !in_array($optionValue, $this->options[$optionName]['values'], true)) {
            throw new \InvalidArgumentException(sprintf('Invalid value "%s" for option "%s", possible values: %s', $optionValue, $optionName, implode(', ', $this->options[$optionName]['values'])), __LINE__);
        } else {
            $this->options[$optionName]['value'] = $optionValue;
        }
        return $this;
    }