Automattic\WooCommerce\Vendor\Sabberworm\CSS\Rule
Rule::setValues
Deprecated since 9.0. It is no longer supported and may be removed in future releases. Use
`setValue()` and wrap value inside a RuleValueList if necessary instead.Method of the class: Rule{}
No Hooks.
Returns
RuleValueList.
Usage
$Rule = new Rule(); $Rule->setValues( $aSpaceSeparatedValues );
- $aSpaceSeparatedValues(array) (required)
- .
Changelog
| Deprecated | will be removed in version 9.0 |
Use
setValue() instead and wrap the value inside a RuleValueList if necessary. Rule::setValues() Rule::setValues code WC 10.5.0
public function setValues(array $aSpaceSeparatedValues)
{
$oSpaceSeparatedList = null;
if (count($aSpaceSeparatedValues) > 1) {
$oSpaceSeparatedList = new RuleValueList(' ', $this->iLineNo);
}
foreach ($aSpaceSeparatedValues as $aCommaSeparatedValues) {
$oCommaSeparatedList = null;
if (count($aCommaSeparatedValues) > 1) {
$oCommaSeparatedList = new RuleValueList(',', $this->iLineNo);
}
foreach ($aCommaSeparatedValues as $mValue) {
if (!$oSpaceSeparatedList && !$oCommaSeparatedList) {
$this->mValue = $mValue;
return $mValue;
}
if ($oCommaSeparatedList) {
$oCommaSeparatedList->addListComponent($mValue);
} else {
$oSpaceSeparatedList->addListComponent($mValue);
}
}
if (!$oSpaceSeparatedList) {
$this->mValue = $oCommaSeparatedList;
return $oCommaSeparatedList;
} else {
$oSpaceSeparatedList->addListComponent($oCommaSeparatedList);
}
}
$this->mValue = $oSpaceSeparatedList;
return $oSpaceSeparatedList;
}