From c766fcb2e2efca2371c9a83ef488d878d645c185 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20L=C3=B8vgaard?= Date: Thu, 9 Jan 2025 12:19:29 +0100 Subject: [PATCH] Add comment explaining sorting --- src/Model/ProductTrait.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Model/ProductTrait.php b/src/Model/ProductTrait.php index b20e911..e0cd6ee 100644 --- a/src/Model/ProductTrait.php +++ b/src/Model/ProductTrait.php @@ -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));