From f41f1215be40371582d946d8b11bd8f6d5c85464 Mon Sep 17 00:00:00 2001 From: Patrick Date: Sat, 5 Feb 2022 20:20:58 +0100 Subject: [PATCH] Update Cart.php --- src/Cart.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Cart.php b/src/Cart.php index 8d4786f..8fa524a 100644 --- a/src/Cart.php +++ b/src/Cart.php @@ -150,8 +150,8 @@ class Cart /* Also allow passing multiple definitions at the same time, simply call same method and collec return value */ else if (is_iterable($id)) { /* Check if this iterable contains instances */ - if (is_array(head($item)) || head($item) instanceof Buyable) { - return array_map(function ($item) { + if (is_array(head($id)) || head($id) instanceof Buyable) { + return array_map(function (Buyable|iterable $item) { return $this->add($item); }, $id); }