mirror of
https://github.com/kevin-DL/LaravelShoppingcart.git
synced 2026-01-23 23:51:25 +00:00
StyleCI
This commit is contained in:
@@ -4,10 +4,12 @@ namespace Gloudemans\Shoppingcart\Calculation;
|
||||
|
||||
use Gloudemans\Shoppingcart\CartItem;
|
||||
|
||||
class DefaultCalculator {
|
||||
static function getAttribute(string $attribute, CartItem $cartItem) {
|
||||
class DefaultCalculator
|
||||
{
|
||||
public static function getAttribute(string $attribute, CartItem $cartItem)
|
||||
{
|
||||
$decimals = config('cart.format.decimals', 2);
|
||||
|
||||
|
||||
switch ($attribute) {
|
||||
case 'discount':
|
||||
return $cartItem->price * ($cartItem->getDiscountRate() / 100);
|
||||
@@ -31,4 +33,4 @@ class DefaultCalculator {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,10 +4,12 @@ namespace Gloudemans\Shoppingcart\Calculation;
|
||||
|
||||
use Gloudemans\Shoppingcart\CartItem;
|
||||
|
||||
class GrossPrice {
|
||||
static function getAttribute(string $attribute, CartItem $cartItem) {
|
||||
class GrossPrice
|
||||
{
|
||||
public static function getAttribute(string $attribute, CartItem $cartItem)
|
||||
{
|
||||
$decimals = config('cart.format.decimals', 2);
|
||||
|
||||
|
||||
switch ($attribute) {
|
||||
case 'priceNet':
|
||||
return round($cartItem->price / (1 + ($cartItem->taxRate / 100)), $decimals);
|
||||
@@ -33,4 +35,4 @@ class GrossPrice {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user