Automattic\WooCommerce\Vendor\Sabberworm\CSS\RuleSet

RuleSet::removeRulepublicWC 1.0

Removes a Rule from this RuleSet by identity.

Method of the class: RuleSet{}

No Hooks.

Returns

null. Nothing (null).

Usage

$RuleSet = new RuleSet();
$RuleSet->removeRule( $mRule );
$mRule(Rule|string|null) (required)
Rule to remove. Passing a string or null is deprecated in version 8.9.0, and will no longer work from v9.0. Use removeMatchingRules() or removeAllRules() instead.

RuleSet::removeRule() code WC 10.8.1

public function removeRule($mRule)
{
    if ($mRule instanceof Rule) {
        $sRule = $mRule->getRule();
        if (!isset($this->aRules[$sRule])) {
            return;
        }
        foreach ($this->aRules[$sRule] as $iKey => $oRule) {
            if ($oRule === $mRule) {
                unset($this->aRules[$sRule][$iKey]);
            }
        }
    } elseif ($mRule !== null) {
        $this->removeMatchingRules($mRule);
    } else {
        $this->removeAllRules();
    }
}