From 143d51b22b365068b2308bb3732eadffb4df266c Mon Sep 17 00:00:00 2001 From: Rob Gloudemans Date: Thu, 13 Oct 2016 12:10:37 +0200 Subject: [PATCH] Make associate() and setTaxRate() return self so it can be chained --- src/CartItem.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/CartItem.php b/src/CartItem.php index 450c3402..35327682 100644 --- a/src/CartItem.php +++ b/src/CartItem.php @@ -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; } /**