public function __construct( protected string
$operator = self::OPERATOR_EQ,
protected ?string
$promotionCodeType = null
) { parent::
__construct();
} public function match(RuleScope
$scope): bool
{ if ($scope instanceof LineItemScope
) { return $this->
lineItemMatches($scope->
getLineItem());
} if (!
$scope instanceof CartRuleScope
) { return false;
} $promotionLineItems =
$scope->
getCart()->
getLineItems()->
filterFlatByType(LineItem::PROMOTION_LINE_ITEM_TYPE
);
$hasNoPromotionLineItems = \
count($promotionLineItems) === 0;
if ($this->operator === self::OPERATOR_EQ &&
$hasNoPromotionLineItems) { return false;
}