Completed
Pull Request — master (#5)
by
unknown
07:08
created

AwsS3AdapterFactory::createAdapter()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Lamoda\Codeception\Extension\AdapterFactory;
4
5
use League\Flysystem\AdapterInterface;
6
use Aws\S3\S3Client;
7
use League\Flysystem\AwsS3v3\AwsS3Adapter;
8
9
class AwsS3AdapterFactory implements AdapterFactoryInterface
10
{
11
    /**
12
     * @param array $config
13
     *
14
     * @return AdapterInterface
15
     */
16 1
    public static function createAdapter(array $config)
17
    {
18 1
        $client = new S3Client($config);
19
20 1
        return new AwsS3Adapter($client, $config['bucket']);
21
    }
22
}
23