Skip to content

Commit

Permalink
Merge pull request #36 from offline-agency/analysis-YOZwYy
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
Giacomo92 authored Jul 12, 2023
2 parents d2b60b9 + 4ab37ca commit 23c1278
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 41 deletions.
44 changes: 22 additions & 22 deletions src/Cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -496,16 +496,16 @@ protected function getCartInfo(): Collection
* * Create a new CartItem from the supplied attributes.
*
*
* @param $id
* @param $name
* @param $subtitle
* @param $qty
* @param $price
* @param $totalPrice
* @param $vatFcCode
* @param $productFcCode
* @param $vat
* @param $urlImg
* @param $id
* @param $name
* @param $subtitle
* @param $qty
* @param $price
* @param $totalPrice
* @param $vatFcCode
* @param $productFcCode
* @param $vat
* @param $urlImg
* @param array $options
* @return CartItem
*/
Expand Down Expand Up @@ -565,7 +565,7 @@ private function isMulti($item): bool
}

/**
* @param $identifier
* @param $identifier
* @return bool
*/
private function storedCartWithIdentifierExists($identifier): bool
Expand Down Expand Up @@ -639,10 +639,10 @@ public function addBatch(array $items): Collection
/**
* Get the Formatted number.
*
* @param $value
* @param $decimals
* @param $decimalPoint
* @param $thousandSeparator
* @param $value
* @param $decimals
* @param $decimalPoint
* @param $thousandSeparator
* @return string
*/
private function numberFormat($value, $decimals, $decimalPoint, $thousandSeparator): string
Expand Down Expand Up @@ -684,7 +684,7 @@ public function coupons(): array
}

/**
* @param $rowId
* @param $rowId
* @param string $couponCode
* @param string $couponType
* @param float $couponValue
Expand Down Expand Up @@ -726,7 +726,7 @@ public function applyCoupon(
}

/**
* @param $rowId
* @param $rowId
* @param string $couponCode
*/
public function detachCoupon(
Expand Down Expand Up @@ -817,9 +817,9 @@ private function formatFloat(float $value): float
}

/**
* @param $couponCode
* @param $couponType
* @param $couponValue
* @param $couponCode
* @param $couponType
* @param $couponValue
*/
private function applyGlobalCoupon(
$couponCode,
Expand Down Expand Up @@ -885,8 +885,8 @@ private function getCartInstance(): string
}

/**
* @param $key
* @param $default_value
* @param $key
* @param $default_value
* @return array|ArrayAccess|mixed|null
*/
public function getOptionsByKey($key, $default_value = null)
Expand Down
38 changes: 19 additions & 19 deletions src/CartItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ class CartItem implements Arrayable, Jsonable
* @param int|string $id
* @param string $name
* @param string $subtitle
* @param $qty
* @param $qty
* @param float $price
* @param $totalPrice
* @param $vatFcCode
* @param $productFcCode
* @param $vat
* @param $urlImg
* @param $totalPrice
* @param $vatFcCode
* @param $productFcCode
* @param $vat
* @param $urlImg
* @param array $options
*/
public function __construct(
Expand Down Expand Up @@ -142,7 +142,7 @@ public function updateFromArray(array $attributes)
/**
* Associate the cart item with a given model or something else.
*
* @param $item
* @param $item
* @param bool $is_model
* @return $this
*/
Expand Down Expand Up @@ -182,7 +182,7 @@ public function __get(string $attribute)
}

if ($attribute === 'total') {
return $this->qty * ($this->priceTax);
return $this->qty * $this->priceTax;
}

if ($attribute === 'tax') {
Expand Down Expand Up @@ -251,16 +251,16 @@ public static function fromArray(array $attributes): CartItem
/**
* * Create a new instance from the given attributes.
*
* @param $id
* @param $name
* @param $subtitle
* @param $qty
* @param $price
* @param $totalPrice
* @param $vatFcCode
* @param $productFcCode
* @param $vat
* @param $urlImg
* @param $id
* @param $name
* @param $subtitle
* @param $qty
* @param $price
* @param $totalPrice
* @param $vatFcCode
* @param $productFcCode
* @param $vat
* @param $urlImg
* @param array $options
* @return CartItem
*/
Expand Down Expand Up @@ -424,7 +424,7 @@ public function applyCoupon(
$this->price = $this->formatFloat($price * -1);
$this->vat = $this->formatFloat($vat * -1);

$this->discountValue = $this->formatFloat(($this->discountValue + $couponValue));
$this->discountValue = $this->formatFloat($this->discountValue + $couponValue);

$this->appliedCoupons[$couponCode]->discountValue = $couponValue;
break;
Expand Down

0 comments on commit 23c1278

Please sign in to comment.