From e40d4fef10cd078ad3b718fbcfd0a92fb205ce99 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 8 Mar 2024 16:39:46 -0600 Subject: [PATCH] formatting --- src/Illuminate/Log/Context/Repository.php | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/Illuminate/Log/Context/Repository.php b/src/Illuminate/Log/Context/Repository.php index da0ee23e792e..341ee86f10b2 100644 --- a/src/Illuminate/Log/Context/Repository.php +++ b/src/Illuminate/Log/Context/Repository.php @@ -147,11 +147,10 @@ public function onlyHidden($keys) */ public function add($key, $value = null) { - $values = is_array($key) ? $key : [$key => $value]; - - foreach ($values as $key => $value) { - $this->data[$key] = $value; - } + $this->data = array_merge( + $this->data, + is_array($key) ? $key : [$key => $value] + ); return $this; } @@ -165,11 +164,10 @@ public function add($key, $value = null) */ public function addHidden($key, $value = null) { - $values = is_array($key) ? $key : [$key => $value]; - - foreach ($values as $key => $value) { - $this->hidden[$key] = $value; - } + $this->hidden = array_merge( + $this->hidden, + is_array($key) ? $key : [$key => $value] + ); return $this; } @@ -352,7 +350,7 @@ public function handleUnserializeExceptionsUsing($callback) } /** - * Flush all state. + * Flush all context data. * * @return $this */