Make associate() and setTaxRate() return self so it can be chained

This commit is contained in:
Rob Gloudemans
2016-10-13 12:10:37 +02:00
committed by GitHub
parent 8bccb54849
commit 143d51b22b

View File

@@ -220,22 +220,26 @@ class CartItem implements Arrayable
* 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;
}
/**