From 9a1eae612b1caab9956df111c712f311679569b3 Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Wed, 8 Mar 2023 14:34:05 -0800 Subject: [PATCH] Reduce nesting --- src/Curl/ArrayUtil.php | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/Curl/ArrayUtil.php b/src/Curl/ArrayUtil.php index 7c264a2..babd2b7 100644 --- a/src/Curl/ArrayUtil.php +++ b/src/Curl/ArrayUtil.php @@ -90,20 +90,18 @@ class ArrayUtil } else { $return[$key] = $value; } + } elseif ($value instanceof \CURLFile) { + $return[$key] = $value; + } elseif ($value instanceof \CURLStringFile) { + $return[$key] = $value; } else { - if ($value instanceof \CURLFile) { - $return[$key] = $value; - } elseif ($value instanceof \CURLStringFile) { - $return[$key] = $value; - } else { - $return = array_merge( - $return, - self::arrayFlattenMultidim( - $value, - $prefix ? $prefix . '[' . $key . ']' : $key - ) - ); - } + $return = array_merge( + $return, + self::arrayFlattenMultidim( + $value, + $prefix ? $prefix . '[' . $key . ']' : $key + ) + ); } } }