public function calculateGross(float
$netPrice, TaxRuleCollection
$rules): float
{ $taxes =
$this->
calculateNetTaxes($netPrice,
$rules);
return $netPrice +
$taxes->
getAmount();
} public function calculateGrossTaxes(float
$price, TaxRuleCollection
$rules): CalculatedTaxCollection
{ $taxes =
[];
foreach ($rules as $rule) { $taxes[] =
$this->
calculateTaxFromGrossPrice($price,
$rule);
} return new CalculatedTaxCollection($taxes);
} public function calculateNetTaxes(float
$price, TaxRuleCollection
$rules): CalculatedTaxCollection
{ $taxes =
[];
foreach ($rules as $rule) { $taxes[] =
$this->
calculateTaxFromNetPrice($price,
$rule);
}