public function __construct( private readonly QuantityPriceCalculator
$quantityPriceCalculator,
private readonly PercentagePriceCalculator
$percentagePriceCalculator,
private readonly AbsolutePriceCalculator
$absolutePriceCalculator ) { } public function calculate(LineItemCollection
$lineItems, SalesChannelContext
$context, CartBehavior
$behavior): LineItemCollection
{ return $this->
calculateLineItems($lineItems,
$context,
$behavior);
} private function calculateLineItems(LineItemCollection
$lineItems, SalesChannelContext
$context, CartBehavior
$behavior): LineItemCollection
{ $workingSet =
clone $lineItems;
$workingSet->
sortByPriority();
$calculated =
new LineItemCollection();
foreach ($workingSet as $original) { $lineItem = LineItem::
createFromLineItem($original);