private function doesRuleCollectionMatchsLineItem(RuleCollection $ruleCollection, LineItemScope $lineItemScope): bool
    {
        /** @var RuleEntity $discountRule */
        foreach ($ruleCollection as $discountRule) {
            $ruleCondition = $discountRule->getPayload();

            if (!$ruleCondition instanceof Rule) {
                continue;
            }

            if ($ruleCondition->match($lineItemScope)) {
                return true;
            }
        }

        return false;
    }
private function doesRuleCollectionMatchsLineItem(RuleCollection $ruleCollection, LineItemScope $lineItemScope): bool
    {
        /** @var RuleEntity $discountRule */
        foreach ($ruleCollection as $discountRule) {
            $ruleCondition = $discountRule->getPayload();

            if (!$ruleCondition instanceof Rule) {
                continue;
            }

            if ($ruleCondition->match($lineItemScope)) {
                return true;
            }
        }

        return false;
    }
private function doesRuleCollectionMatchsLineItem ( RuleCollection $ ruleCollection , LineItemScope $ lineItemScope ) : bool { /** @var RuleEntity $discountRule */ foreach ( $ ruleCollection as $ discountRule ) { $ ruleCondition = $ discountRule -> getPayload ( ) ; if ( ! $ ruleCondition instanceof Rule ) { continue ; } if ( $ ruleCondition -> match ( $ lineItemScope ) ) { return true ; } } return false ; }
checks if a ruleCollection matches a lineItem. This function returns true if ONE rule in collection matches lineItem,
otherwise returns false
checks if a ruleCollection matches a lineItem . This function returns true if ONE rule in collection matches lineItem otherwise returns false