Automattic\WooCommerce\Vendor\Sabberworm\CSS\Rule

Rule::addValuepublicWC 1.0

Adds a value to the existing value. Value will be appended if a RuleValueList exists of the given type. Otherwise, the existing value will be wrapped by one.

Method of the class: Rule{}

No Hooks.

Returns

null. Nothing (null).

Usage

$Rule = new Rule();
$Rule->addValue( $mValue, $sType );
$mValue(required)
.
$sType(string)
.
Default: ' '

Rule::addValue() code WC 10.8.1

public function addValue($mValue, $sType = ' ')
{
    if (!is_array($mValue)) {
        $mValue = [$mValue];
    }
    if (!$this->mValue instanceof RuleValueList || $this->mValue->getListSeparator() !== $sType) {
        $mCurrentValue = $this->mValue;
        $this->mValue = new RuleValueList($sType, $this->getLineNumber());
        if ($mCurrentValue) {
            $this->mValue->addListComponent($mCurrentValue);
        }
    }
    foreach ($mValue as $mValueItem) {
        $this->mValue->addListComponent($mValueItem);
    }
}