Code Duplication    Length = 9-18 lines in 3 locations

src/Gaufrette/Adapter/AmazonS3.php 1 location

@@ 25-33 (lines=9) @@
22
    protected $metadata;
23
    protected $options;
24
25
    public function __construct(AmazonClient $service, $bucket, $options = array())
26
    {
27
        $this->service = $service;
28
        $this->bucket = $bucket;
29
        $this->options = array_replace_recursive(
30
            array('directory' => '', 'create' => false, 'region' => $service->hostname, 'acl' => AmazonClient::ACL_PUBLIC),
31
            $options
32
        );
33
    }
34
35
    /**
36
     * Set the acl used when writing files.

src/Gaufrette/Adapter/AwsS3.php 1 location

@@ 27-41 (lines=15) @@
24
    protected $metadata = array();
25
    protected $detectContentType;
26
27
    public function __construct(S3Client $service, $bucket, array $options = array(), $detectContentType = false)
28
    {
29
        $this->service = $service;
30
        $this->bucket = $bucket;
31
        $this->options = array_replace(
32
            array(
33
                'create' => false,
34
                'directory' => '',
35
                'acl' => 'private',
36
            ),
37
            $options
38
        );
39
40
        $this->detectContentType = $detectContentType;
41
    }
42
43
    /**
44
     * Gets the publicly accessible URL of an Amazon S3 object.

src/Gaufrette/Adapter/GoogleCloudStorage.php 1 location

@@ 31-48 (lines=18) @@
28
     * @param array                   $options           Options can be directory and acl
29
     * @param bool                    $detectContentType Whether to detect the content type or not
30
     */
31
    public function __construct(
32
        \Google_Service_Storage $service,
33
        $bucket,
34
        array $options = array(),
35
        $detectContentType = false
36
    ) {
37
        $this->service = $service;
38
        $this->bucket = $bucket;
39
        $this->options = array_replace(
40
            array(
41
                'directory' => '',
42
                'acl' => 'private',
43
            ),
44
            $options
45
        );
46
47
        $this->detectContentType = $detectContentType;
48
    }
49
50
    /**
51
     * @return array The actual options