public function surcharge(string
$key, string
$type, float|PriceCollection
$value, string
$label): DiscountFacade
{ $definition =
$this->
buildSurchargeDefinition($type,
$value,
$key);
$item =
new LineItem($key, LineItem::DISCOUNT_LINE_ITEM, null, 1
);
$item->
setGood(false
);
$item->
setPriceDefinition($definition);
$item->
setLabel($label);
$item->
setRemovable(true
);
$this->
getItems()->
add($item);
return new DiscountFacade($item);
} private function getItems(): LineItemCollection
{ return $this->items;
} private function buildSurchargeDefinition(string
$type, float|PriceCollection|string|int
$value, string
$key): PriceDefinitionInterface
{ if ($type === PercentagePriceDefinition::TYPE
) { if ($value instanceof PriceCollection
) {