Skip to content

Commit dc8d9d6

Browse files
authored
Add more precise types for the SimpleS3 integration (#1491)
1 parent bc92cce commit dc8d9d6

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

src/Integration/Aws/SimpleS3/src/SimpleS3Client.php

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ public function has(string $bucket, string $key): bool
4848
}
4949

5050
/**
51-
* @param string|resource|callable|iterable $object
51+
* @param string|resource|(callable(int): string)|iterable<string> $object
5252
* @param array{
5353
* ACL?: \AsyncAws\S3\Enum\ObjectCannedACL::*,
5454
* CacheControl?: string,
55-
* ContentLength?: string,
55+
* ContentLength?: int,
5656
* ContentType?: string,
5757
* Metadata?: array<string, string>,
5858
* PartSize?: int,
@@ -144,6 +144,9 @@ public function upload(string $bucket, string $key, $object, array $options = []
144144
]);
145145
}
146146

147+
/**
148+
* @param string|resource|(callable(int): string)|iterable<string> $object
149+
*/
147150
private function getStream($object, int $chunkSize): FixedSizeStream
148151
{
149152
return FixedSizeStream::create(
@@ -152,6 +155,9 @@ private function getStream($object, int $chunkSize): FixedSizeStream
152155
);
153156
}
154157

158+
/**
159+
* @param resource $buffer
160+
*/
155161
private function doMultipartUpload(string $bucket, string $key, string $uploadId, int $partNumber, $buffer): CompletedPart
156162
{
157163
try {
@@ -171,7 +177,17 @@ private function doMultipartUpload(string $bucket, string $key, string $uploadId
171177
}
172178
}
173179

174-
private function doSmallFileUpload(array $options, string $bucket, string $key, $object)
180+
/**
181+
* @param array{
182+
* ACL?: \AsyncAws\S3\Enum\ObjectCannedACL::*,
183+
* CacheControl?: string,
184+
* ContentLength?: int,
185+
* ContentType?: string,
186+
* Metadata?: array<string, string>,
187+
* } $options
188+
* @param string|resource|(callable(int): string)|iterable<string> $object
189+
*/
190+
private function doSmallFileUpload(array $options, string $bucket, string $key, $object): void
175191
{
176192
$this->putObject(array_merge($options, [
177193
'Bucket' => $bucket,

0 commit comments

Comments
 (0)