From e12252b41c04ea933d5b49ed953b7619186a726b Mon Sep 17 00:00:00 2001 From: Walmir Silva Date: Wed, 30 Oct 2024 19:12:58 -0300 Subject: [PATCH] fix: remove check hasKey in set method --- src/Collection/ArrayList.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Collection/ArrayList.php b/src/Collection/ArrayList.php index 34df681..0039cfe 100644 --- a/src/Collection/ArrayList.php +++ b/src/Collection/ArrayList.php @@ -75,9 +75,9 @@ public function set(mixed $key, mixed $element): void if (! $this->isValidArrayKey($key)) { throw new \InvalidArgumentException('Invalid key type: ' . gettype($key)); } - if (! $this->hasKey($key)) { - throw new \OutOfRangeException('Key not found: ' . $this->keyToString($key)); - } + // if (! $this->hasKey($key)) { + // throw new \OutOfRangeException('Key not found: ' . $this->keyToString($key)); + // } $this->elements[$key] = $element; }