From b8de1c2b47114816e21ad0d85adf26d373ed9332 Mon Sep 17 00:00:00 2001 From: Olivier Bellone Date: Fri, 2 Aug 2019 22:02:19 +0800 Subject: [PATCH] Use array_column to flatten params --- lib/File.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/File.php b/lib/File.php index 76109ad38..e7bf70b39 100644 --- a/lib/File.php +++ b/lib/File.php @@ -52,11 +52,7 @@ public static function create($params = null, $options = null) } // Manually flatten params, otherwise curl's multipart encoder will // choke on nested arrays. - // TODO: use array_column() once we drop support for PHP 5.4 - $flatParams = []; - foreach (\Stripe\Util\Util::flattenParams($params) as $pair) { - $flatParams[$pair[0]] = $pair[1]; - } + $flatParams = array_column(\Stripe\Util\Util::flattenParams($params), 1, 0); return static::_create($flatParams, $opts); } }