refactoring, variable renamed
This commit is contained in:
parent
214d7a8161
commit
da90ed31b5
|
|
@ -13,16 +13,16 @@ class Tax
|
|||
/**
|
||||
* Returns an array with tax rates and tax amount
|
||||
*
|
||||
* @param \Webkul\Checkout\Contracts\Cart $that
|
||||
* @param \Webkul\Checkout\Contracts\Cart $cart
|
||||
* @param bool $asBase
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getTaxRatesWithAmount(\Webkul\Checkout\Contracts\Cart $that, bool $asBase = false): array
|
||||
public static function getTaxRatesWithAmount(\Webkul\Checkout\Contracts\Cart $cart, bool $asBase = false): array
|
||||
{
|
||||
$taxes = [];
|
||||
|
||||
foreach ($that->items as $item) {
|
||||
foreach ($cart->items as $item) {
|
||||
$taxRate = (string) round((float) $item->tax_percent, self::TAX_RATE_PRECISION);
|
||||
|
||||
if (! array_key_exists($taxRate, $taxes)) {
|
||||
|
|
@ -43,14 +43,14 @@ class Tax
|
|||
/**
|
||||
* Returns the total tax amount
|
||||
*
|
||||
* @param \Webkul\Checkout\Contracts\Cart $that
|
||||
* @param \Webkul\Checkout\Contracts\Cart $cart
|
||||
* @param bool $asBase
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public static function getTaxTotal(\Webkul\Checkout\Contracts\Cart $that, bool $asBase = false): float
|
||||
public static function getTaxTotal(\Webkul\Checkout\Contracts\Cart $cart, bool $asBase = false): float
|
||||
{
|
||||
$taxes = self::getTaxRatesWithAmount($that, $asBase);
|
||||
$taxes = self::getTaxRatesWithAmount($cart, $asBase);
|
||||
|
||||
$result = 0;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue