Skip to content

Commit

Permalink
🎨 Factored out else for #61
Browse files Browse the repository at this point in the history
  • Loading branch information
carbontwelve committed Jan 11, 2017
1 parent ca8d452 commit f265d91
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/ArrayContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}

/**
Expand Down

0 comments on commit f265d91

Please sign in to comment.