Automattic\WooCommerce\Vendor\Sabberworm\CSS\RuleSet
DeclarationBlock::setSelectors
Method of the class: DeclarationBlock{}
No Hooks.
Returns
null. Nothing (null).
Usage
$DeclarationBlock = new DeclarationBlock(); $DeclarationBlock->setSelectors( $mSelector, $oList );
- $mSelector(required)
- .
- $oList(CSSList|null)
- .
Default:null
DeclarationBlock::setSelectors() DeclarationBlock::setSelectors code WC 10.4.3
public function setSelectors($mSelector, $oList = null)
{
if (is_array($mSelector)) {
$this->aSelectors = $mSelector;
} else {
$this->aSelectors = explode(',', $mSelector);
}
foreach ($this->aSelectors as $iKey => $mSelector) {
if (!($mSelector instanceof Selector)) {
if ($oList === null || !($oList instanceof KeyFrame)) {
if (!Selector::isValid($mSelector)) {
throw new UnexpectedTokenException(
"Selector did not match '" . Selector::SELECTOR_VALIDATION_RX . "'.",
$mSelector,
"custom"
);
}
$this->aSelectors[$iKey] = new Selector($mSelector);
} else {
if (!KeyframeSelector::isValid($mSelector)) {
throw new UnexpectedTokenException(
"Selector did not match '" . KeyframeSelector::SELECTOR_VALIDATION_RX . "'.",
$mSelector,
"custom"
);
}
$this->aSelectors[$iKey] = new KeyframeSelector($mSelector);
}
}
}
}