Skip to content

Commit

Permalink
Add comment explaining sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
loevgaard committed Jan 9, 2025
1 parent 209944e commit c766fcb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Model/ProductTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public function hasPreQualifiedCatalogPromotions(): bool
*/
private static function sanitizeCodes(array $codes): array
{
// The reason for sorting is that we use the imploded string as a cache key elsewhere
sort($codes, \SORT_STRING);

return array_values(array_unique($codes));
Expand Down

0 comments on commit c766fcb

Please sign in to comment.