Code Duplication    Length = 9-10 lines in 4 locations

src/Gaufrette/Adapter/AwsS3.php 3 locations

@@ 160-169 (lines=10) @@
157
    /**
158
     * {@inheritdoc}
159
     */
160
    public function mtime($key)
161
    {
162
        try {
163
            $result = $this->service->headObject($this->getOptions($key));
164
165
            return strtotime($result['LastModified']);
166
        } catch (\Exception $e) {
167
            return false;
168
        }
169
    }
170
171
    /**
172
     * {@inheritdoc}
@@ 174-183 (lines=10) @@
171
    /**
172
     * {@inheritdoc}
173
     */
174
    public function size($key)
175
    {
176
        try {
177
            $result = $this->service->headObject($this->getOptions($key));
178
179
            return $result['ContentLength'];
180
        } catch (\Exception $e) {
181
            return false;
182
        }
183
    }
184
185
    /**
186
     * {@inheritdoc}
@@ 336-344 (lines=9) @@
333
        return $fileInfo->buffer($content);
334
    }
335
336
    public function mimeType($key)
337
    {
338
        try {
339
            $result = $this->service->headObject($this->getOptions($key));
340
341
            return ($result['ContentType']);
342
        } catch (\Exception $e) {
343
            return false;
344
        }
345
    }
346
}
347

src/Gaufrette/Adapter/AsyncAwsS3.php 1 location

@@ 163-172 (lines=10) @@
160
    /**
161
     * {@inheritdoc}
162
     */
163
    public function mtime($key)
164
    {
165
        try {
166
            $result = $this->service->headObject($this->getOptions($key));
167
168
            return $result->getLastModified()->getTimestamp();
169
        } catch (\Exception $e) {
170
            return false;
171
        }
172
    }
173
174
    /**
175
     * {@inheritdoc}