Conditions | 1 |
Paths | 1 |
Total Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
12 | public function __invoke(array $options) |
||
13 | { |
||
14 | $key = $options['key'] ?? null; |
||
15 | $secret = $options['secret'] ?? null; |
||
16 | $region = $options['region'] ?? 'us-east-1'; |
||
17 | $version = $options['version'] ?? 'latest'; |
||
18 | $bucket = $options['bucket'] ?? null; |
||
19 | $prefix = $options['prefix'] ?? null; |
||
20 | |||
21 | $client = new S3Client([ |
||
22 | 'version' => $version, |
||
23 | 'region' => $region, |
||
24 | 'credentials' => [ |
||
25 | 'key' => $key, |
||
26 | 'secret' => $secret |
||
27 | ] |
||
28 | ]); |
||
29 | |||
30 | return new AwsS3Adapter($client, $bucket, $prefix); |
||
31 | } |
||
32 | } |
||
33 |