Automattic\WooCommerce\Vendor\Sabberworm\CSS\CSSList

CSSList::insertBeforepublicWC 1.0

Inserts an item in the CSS list before its sibling. If the desired sibling cannot be found, the item is appended at the end.

Method of the class: CSSList{}

No Hooks.

Returns

null. Nothing (null).

Usage

$CSSList = new CSSList();
$CSSList->insertBefore( $item, $sibling );
$item(RuleSet|CSSList|Import|Charset) (required)
.
$sibling(RuleSet|CSSList|Import|Charset) (required)
.

CSSList::insertBefore() code WC 10.5.0

public function insertBefore($item, $sibling)
{
    if (in_array($sibling, $this->aContents, true)) {
        $this->replace($sibling, [$item, $sibling]);
    } else {
        $this->append($item);
    }
}