Skip to content

Commit

Permalink
Make associate() and setTaxRate() return self so it can be chained
Browse files Browse the repository at this point in the history
  • Loading branch information
Crinsane authored Oct 13, 2016
1 parent 8bccb54 commit 143d51b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/CartItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,22 +220,26 @@ public function updateFromArray(array $attributes)
* Associate the cart item with the given model.
*
* @param mixed $model
* @return void
* @return \Gloudemans\Shoppingcart\CartItem
*/
public function associate($model)
{
$this->associatedModel = is_string($model) ? $model : get_class($model);

return $this;
}

/**
* Set the tax rate.
*
* @param int|float $taxRate
* @return void
* @return \Gloudemans\Shoppingcart\CartItem
*/
public function setTaxRate($taxRate)
{
$this->taxRate = $taxRate;

return $this;
}

/**
Expand Down

0 comments on commit 143d51b

Please sign in to comment.