public function match(RuleScope
$scope): bool
{ if (!
$scope instanceof CheckoutRuleScope
) { return false;
} if (!
$address =
$scope->
getSalesChannelContext()->
getShippingLocation()->
getAddress()) { return RuleComparison::
isNegativeOperator($this->operator
);
} if (!\
is_string($this->cityName
) &&
$this->operator !== self::OPERATOR_EMPTY
) { throw new UnsupportedValueException(\
gettype($this->cityName
), self::
class);
} return RuleComparison::
string($address->
getCity(),
$this->cityName ?? '',
$this->operator
);
} public function getConstraints(): array
{ $constraints =
[ 'operator' =>
[ new NotBlank(),
new Choice([Rule::OPERATOR_EQ, Rule::OPERATOR_NEQ, Rule::OPERATOR_EMPTY
]),
],