Skip to content

Commit

Permalink
Dry up \Illuminate\Config\Repository::set. (#15953)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmichot authored and taylorotwell committed Oct 17, 2016
1 parent cdcd98b commit 125bbe1
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/Illuminate/Config/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,9 @@ public function get($key, $default = null)
*/
public function set($key, $value = null)
{
if (is_array($key)) {
foreach ($key as $innerKey => $innerValue) {
Arr::set($this->items, $innerKey, $innerValue);
}
} else {
$keys = is_array($key) ? $key : [$key => $value];

foreach ($keys as $key => $value) {
Arr::set($this->items, $key, $value);
}
}
Expand Down

0 comments on commit 125bbe1

Please sign in to comment.