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