use Shopware\Core\Checkout\Promotion\Cart\Discount\DiscountPackageCollection;
use Shopware\Core\Checkout\Promotion\Cart\Discount\Filter\FilterSorterInterface;
use Shopware\Core\Framework\Log\Package;
#[Package('buyers-experience')]
abstract class AbstractPriceSorter implements FilterSorterInterface
{ public function sort(DiscountPackageCollection
$packages): DiscountPackageCollection
{ foreach ($packages as $package) { /** @var array<LineItemQuantity> $metaItems */
$metaItems =
$package->
getMetaData()->
getElements();
$metaItems =
$this->
_sort($metaItems,
$package);
$package->
setMetaItems(new LineItemQuantityCollection($metaItems));
} return $packages;
} /**
* @param array<string, LineItemQuantity[]> $map
*
* @return array<string, LineItemQuantity[]>
*/