diff --git a/src/ObjectClient.php b/src/ObjectClient.php index bcc174e..a26617c 100644 --- a/src/ObjectClient.php +++ b/src/ObjectClient.php @@ -60,7 +60,7 @@ public function deleteObject(string $key, string $versionId = null): Http\Respon public function deleteObjects(array $body): Http\Response { - if (key($body) == 'Delete') { + if (array_key_first($body) == 'Delete') { $body = $body['Delete']; } @@ -74,7 +74,7 @@ public function optionsObject(string $key): Http\Response public function restoreObject(string $key, array $body, string $versionId = null): Http\Response { - if (key($body) == 'RestoreRequest') { + if (array_key_first($body) == 'RestoreRequest') { $body = $body['RestoreRequest']; } @@ -89,7 +89,7 @@ public function restoreObject(string $key, array $body, string $versionId = null public function selectObjectContents(string $key, array $body): Http\Response { - if (key($body) == 'SelectRequest') { + if (array_key_first($body) == 'SelectRequest') { $body = $body['SelectRequest']; } @@ -104,7 +104,7 @@ public function selectObjectContents(string $key, array $body): Http\Response public function putObjectACL(string $key, array $body, array $headers = []): Http\Response { - if (key($body) == 'AccessControlPolicy') { + if (array_key_first($body) == 'AccessControlPolicy') { $body = $body['AccessControlPolicy']; } @@ -128,7 +128,7 @@ public function getObjectACL(string $key): Http\Response public function putObjectTagging(string $key, array $body, string $versionId = null): Http\Response { - if (key($body) == 'Tagging') { + if (array_key_first($body) == 'Tagging') { $body = $body['Tagging']; } @@ -209,7 +209,7 @@ public function copyPart(string $key, int $partNumber, string $uploadId, array $ public function markUploadAsCompleted(string $key, string $uploadId, array $body): Http\Response { - if (key($body) == 'CompleteMultipartUpload') { + if (array_key_first($body) == 'CompleteMultipartUpload') { $body = $body['CompleteMultipartUpload']; }