switch ($shippingMethod->
getTaxType()) { case ShippingMethodEntity::TAX_TYPE_HIGHEST:
$rules =
$calculatedLineItems->
getPrices()->
getHighestTaxRule();
break;
case ShippingMethodEntity::TAX_TYPE_FIXED:
$tax =
$shippingMethod->
getTax();
if ($tax !== null
) { $rules =
$context->
buildTaxRules($tax->
getId());
break;
} // no break
default:
$rules =
$this->percentageTaxRuleBuilder->
buildRules( $calculatedLineItems->
getPrices()->
sum() );
}