return [ 'operator' => RuleConstraints::
numericOperators(false
),
'stock' => RuleConstraints::
int(),
];
} public function getConfig(): RuleConfig
{ return (new RuleConfig()) ->
operatorSet(RuleConfig::OPERATOR_SET_NUMBER
) ->
intField('stock'
);
} /**
* @throws UnsupportedOperatorException|UnsupportedValueException
*/
private function matchStock(LineItem
$lineItem): bool
{ if ($this->stock === null
) { throw new UnsupportedValueException(\
gettype($this->stock
), self::
class);
}