From 09531cfa0262dec681b79b55b06f091b3d01d74b Mon Sep 17 00:00:00 2001 From: jwj <86849180@qq.com> Date: Mon, 20 Nov 2023 16:42:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20body=20=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ObjectClient.php | 2 +- src/Support/XML.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ObjectClient.php b/src/ObjectClient.php index 9322ee2..d83d309 100644 --- a/src/ObjectClient.php +++ b/src/ObjectClient.php @@ -193,7 +193,7 @@ public function markUploadAsCompleted(string $key, string $uploadId, array $body 'query' => [ 'uploadId' => $uploadId, ], - 'body' => XML::fromArray($body), + 'body' => XML::fromArray($body, 'CompleteMultipartUpload', 'Part'), ]); } diff --git a/src/Support/XML.php b/src/Support/XML.php index 42a9275..9062d2c 100644 --- a/src/Support/XML.php +++ b/src/Support/XML.php @@ -11,12 +11,12 @@ public static function toArray(string $xml): array return Transformer::toArray($xml); } - public static function fromArray(array $data): bool|string + public static function fromArray(array $data, string $root = 'xml', string $item = 'item'): bool|string { if (empty($data)) { return ''; } - return Transformer::toXml($data); + return Transformer::toXml($data, root: $root, item: $item); } }