From f265d9135162bd764f1ec386188f7418e59f801d Mon Sep 17 00:00:00 2001 From: Simon Dann Date: Wed, 11 Jan 2017 12:03:01 +0000 Subject: [PATCH] :art: Factored out else for #61 --- src/ArrayContainer.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ArrayContainer.php b/src/ArrayContainer.php index 78f9c39..13c45c2 100644 --- a/src/ArrayContainer.php +++ b/src/ArrayContainer.php @@ -62,16 +62,18 @@ public function set($key, $value) * Remove an items from the container by $key. * * @param string $key + * @return void */ public function remove($key) { + $this->removeKeyFromNestedCache($key); + if ($this->isNestedKey($key)) { $this->removeNestedValueByKey($key); - } else { - unset($this->items[$key]); + return; } - $this->removeKeyFromNestedCache($key); + unset($this->items[$key]); } /**