Automattic\WooCommerce\Vendor\Sabberworm\CSS\RuleSet

RuleSet::removeMatchingRulespublicWC 1.0

Removes rules by property name or search pattern.

Method of the class: RuleSet{}

No Hooks.

Returns

null. Nothing (null).

Usage

$RuleSet = new RuleSet();
$RuleSet->removeMatchingRules( $searchPattern );
$searchPattern(string) (required)
pattern to remove. If the pattern ends in a dash, all rules starting with the pattern are removed as well as one matching the pattern with the dash excluded.

RuleSet::removeMatchingRules() code WC 10.8.1

public function removeMatchingRules($searchPattern)
{
    foreach ($this->aRules as $propertyName => $rules) {
        // Either the search rule matches the found rule exactly
        // or the search rule ends in “-” and the found rule starts with the search rule or equals it
        // (without the trailing dash).
        if (
            $propertyName === $searchPattern
            || (\strrpos($searchPattern, '-') === \strlen($searchPattern) - \strlen('-')
                && (\strpos($propertyName, $searchPattern) === 0
                    || $propertyName === \substr($searchPattern, 0, -1)))
        ) {
            unset($this->aRules[$propertyName]);
        }
    }
}