Skip to content

Commit

Permalink
Merge pull request #686 from stripe/ob-use-array-column
Browse files Browse the repository at this point in the history
Use array_column to flatten params
  • Loading branch information
ob-stripe authored Aug 2, 2019
2 parents e573ad2 + b8de1c2 commit 5d4a036
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit 5d4a036

Please sign in to comment.