Automattic\WooCommerce\Vendor\Sabberworm\CSS\RuleSet
DeclarationBlock::setSelectors
Метод класса: DeclarationBlock{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$DeclarationBlock = new DeclarationBlock(); $DeclarationBlock->setSelectors( $mSelector, $oList );
- $mSelector(array<int, Selector|string>|строка) (обязательный)
- .
- $oList(CSSList|null)
- .
По умолчанию:null
Код DeclarationBlock::setSelectors() DeclarationBlock::setSelectors WC 11.2.1
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);
}
}
}
}