1 | <?php |
||
13 | class AwsS3PresignedUrlResolver implements ResolverInterface |
||
14 | { |
||
15 | /** @var S3Client */ |
||
16 | private $service; |
||
17 | |||
18 | /** @var string */ |
||
19 | private $bucket; |
||
20 | |||
21 | /** @var string */ |
||
22 | private $baseDir; |
||
23 | |||
24 | /** @var \DateTimeInterface */ |
||
25 | private $expiresAt; |
||
26 | |||
27 | /** |
||
28 | * @param S3Client $service Could be the same as the one given to the adapter or any other S3 client. |
||
29 | * @param string $bucket Same as the one given to adapter. |
||
30 | * @param string $baseDir Same as the one given to adapter. |
||
31 | * @param \DateTimeInterface $expiresAt Presigned links are valid for a certain amount time of time only. |
||
32 | */ |
||
33 | public function __construct(S3Client $service, $bucket, $baseDir, \DateTimeInterface $expiresAt) |
||
40 | |||
41 | /** |
||
42 | * Resolves given object path into presigned request URI. |
||
43 | * |
||
44 | * @param string $path |
||
45 | * |
||
46 | * @return (string) \Psr\Http\Message\UriInterface |
||
47 | */ |
||
48 | public function resolve($path) |
||
57 | |||
58 | /** |
||
59 | * Appends baseDir to $key. |
||
60 | * |
||
61 | * @param string $key |
||
62 | * |
||
63 | * @return string |
||
64 | */ |
||
65 | private function computePath($key) |
||
69 | } |
||
70 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: