#[Package('buyers-experience')]
class SalutationSorter extends AbstractSalutationsSorter
{ public function getDecorated(): AbstractSalutationsSorter
{ throw new DecorationPatternException(self::
class);
} public function sort(SalutationCollection
$salutations): SalutationCollection
{ $salutations->
sort(function DSalutationEntity
$a, SalutationEntity
$b) { if ($a->
getSalutationKey() === SalutationDefinition::NOT_SPECIFIED
) { return -1;
} if ($b->
getSalutationKey() === SalutationDefinition::NOT_SPECIFIED
) { return 1;
} return $b->
getSalutationKey() <=>
$a->
getSalutationKey();
});
return $salutations;
}