I've always disliked the TaxRateAmount object name and its getAmount() method (which leads to $rate->getAmount()->getAmount()).
"amount" is vague language for what is basically the percentage.

Now that #2894792: Add Adjustment::getPercentage() has landed, we discussed internally three choices for making TaxRateAmount::getAmount() less confusing:
1) TaxRateAmount::getPercentage()
2) TaxRatePercentage::getAmount()
3) TaxRatePercentage::getNumber()
All three were deemed to be improvements over the current code. In the end we decided to go with #3, avoiding all "amount" language, and making a parallel with the Price object which also has a getNumber() method.

Comments

bojanz created an issue. See original summary.

bojanz’s picture

Assigned: Unassigned » bojanz

  • bojanz committed 6571386 on 8.x-2.x
    Issue #2900722: Rename TaxRateAmount to TaxRatePercentage
    
bojanz’s picture

Status: Active » Fixed

Done. The word amount is now only used for prices in Commerce.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.