Code Duplication    Length = 18-22 lines in 3 locations

src/Gaufrette/Adapter/AwsS3.php 1 location

@@ 35-52 (lines=18) @@
32
     * @param array    $options
33
     * @param bool     $detectContentType
34
     */
35
    public function __construct(S3Client $service, $bucket, array $options = [], $detectContentType = false)
36
    {
37
        if (!class_exists(S3Client::class)) {
38
            throw new \LogicException('You need to install package "aws/aws-sdk-php" to use this adapter');
39
        }
40
        $this->service = $service;
41
        $this->bucket = $bucket;
42
        $this->options = array_replace(
43
            [
44
                'create' => false,
45
                'directory' => '',
46
                'acl' => 'private',
47
            ],
48
            $options
49
        );
50
51
        $this->detectContentType = $detectContentType;
52
    }
53
54
    /**
55
     * {@inheritdoc}

src/Gaufrette/Adapter/GoogleCloudStorage.php 1 location

@@ 29-50 (lines=22) @@
26
     * @param array                   $options           Options can be directory and acl
27
     * @param bool                    $detectContentType Whether to detect the content type or not
28
     */
29
    public function __construct(
30
        \Google_Service_Storage $service,
31
        $bucket,
32
        array $options = [],
33
        $detectContentType = false
34
    ) {
35
        if (!class_exists(\Google_Service_Storage::class)) {
36
            throw new \LogicException('You need to install package "google/apiclient" to use this adapter');
37
        }
38
39
        $this->service = $service;
40
        $this->bucket = $bucket;
41
        $this->options = array_replace(
42
            [
43
                'directory' => '',
44
                'acl' => 'private',
45
            ],
46
            $options
47
        );
48
49
        $this->detectContentType = $detectContentType;
50
    }
51
52
    /**
53
     * @return array The actual options

src/Gaufrette/Adapter/AsyncAwsS3.php 1 location

@@ 36-53 (lines=18) @@
33
     * @param array    $options
34
     * @param bool     $detectContentType
35
     */
36
    public function __construct(SimpleS3Client $service, $bucket, array $options = [], $detectContentType = false)
37
    {
38
        if (!class_exists(SimpleS3Client::class)) {
39
            throw new \LogicException('You need to install package "async-aws/simple-s3" to use this adapter');
40
        }
41
        $this->service = $service;
42
        $this->bucket = $bucket;
43
        $this->options = array_replace(
44
            [
45
                'create' => false,
46
                'directory' => '',
47
                'acl' => 'private',
48
            ],
49
            $options
50
        );
51
52
        $this->detectContentType = $detectContentType;
53
    }
54
55
    /**
56
     * {@inheritdoc}