1 | <?php |
||
15 | class AwsS3PresignedUrlResolver implements ResolverInterface |
||
16 | { |
||
17 | /** @var S3Client */ |
||
18 | private $service; |
||
19 | |||
20 | /** @var string */ |
||
21 | private $bucket; |
||
22 | |||
23 | /** @var string */ |
||
24 | private $baseDir; |
||
25 | |||
26 | /** @var \DateTimeInterface */ |
||
27 | private $expiresAt; |
||
28 | |||
29 | /** |
||
30 | * @param S3Client $service Could be the same as the one given to the adapter or any other S3 client. |
||
31 | * @param string $bucket Same as the one given to adapter. |
||
32 | * @param string $baseDir Same as the one given to adapter. |
||
33 | * @param \DateTimeInterface $expiresAt Presigned links are valid for a certain amount time of time only. |
||
34 | */ |
||
35 | public function __construct(S3Client $service, $bucket, $baseDir, \DateTimeInterface $expiresAt) |
||
42 | |||
43 | /** |
||
44 | * Resolves given object path into presigned request URI. |
||
45 | * |
||
46 | * @param string $path |
||
47 | * |
||
48 | * @return string |
||
49 | */ |
||
50 | public function resolve($path) |
||
69 | |||
70 | /** |
||
71 | * Appends baseDir to $key. |
||
72 | * |
||
73 | * @param string $key |
||
74 | * |
||
75 | * @return string |
||
76 | */ |
||
77 | private function computePath($key) |
||
81 | } |
||
82 |
This error could be the result of:
1. Missing dependencies
PHP Analyzer uses your
composer.json
file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects thecomposer.json
to be in the root folder of your repository.Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the
require
orrequire-dev
section?2. Missing use statement
PHP does not complain about undefined classes in
ìnstanceof
checks. For example, the following PHP code will work perfectly fine:If you have not tested against this specific condition, such errors might go unnoticed.