return [ 'operator' => RuleConstraints::
numericOperators(false
),
'amount' => RuleConstraints::
float(),
];
} public function getConfig(): RuleConfig
{ return (new RuleConfig()) ->
operatorSet(RuleConfig::OPERATOR_SET_NUMBER
) ->
numberField('amount',
['unit' => RuleConfig::UNIT_VOLUME
]);
} /**
* @throws UnsupportedOperatorException
*/
private function matchVolumeDimension(LineItem
$lineItem): bool
{ $deliveryInformation =
$lineItem->
getDeliveryInformation();
if (!
$deliveryInformation instanceof DeliveryInformation
) { return RuleComparison::
isNegativeOperator($this->operator
);
}