From 571fcd85321ae592a6a5fc3ed02860ae66024978 Mon Sep 17 00:00:00 2001 From: Lucas Michot Date: Sat, 15 Oct 2016 22:26:25 +0200 Subject: [PATCH] Dry up \Illuminate\Config\Repository::set. --- src/Illuminate/Config/Repository.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Illuminate/Config/Repository.php b/src/Illuminate/Config/Repository.php index 184a04a2a2cc..2c00686a4de7 100644 --- a/src/Illuminate/Config/Repository.php +++ b/src/Illuminate/Config/Repository.php @@ -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); } }