Code Duplication    Length = 10-10 lines in 4 locations

src/Gaufrette/Adapter/AzureBlobStorage.php 1 location

@@ 538-547 (lines=10) @@
535
     *
536
     * @return string
537
     */
538
    private function guessContentType($content)
539
    {
540
        $fileInfo = new \finfo(FILEINFO_MIME_TYPE);
541
542
        if (is_resource($content)) {
543
            return $fileInfo->file(stream_get_meta_data($content)['uri']);
544
        }
545
546
        return $fileInfo->buffer($content);
547
    }
548
549
    /**
550
     * @param string $key

src/Gaufrette/Adapter/AwsS3.php 1 location

@@ 325-334 (lines=10) @@
322
     *
323
     * @return string
324
     */
325
    private function guessContentType($content)
326
    {
327
        $fileInfo = new \finfo(FILEINFO_MIME_TYPE);
328
329
        if (is_resource($content)) {
330
            return $fileInfo->file(stream_get_meta_data($content)['uri']);
331
        }
332
333
        return $fileInfo->buffer($content);
334
    }
335
336
    public function mimeType($key)
337
    {

src/Gaufrette/Adapter/GoogleCloudStorage.php 1 location

@@ 391-400 (lines=10) @@
388
     *
389
     * @return string
390
     */
391
    private function guessContentType($content)
392
    {
393
        $fileInfo = new \finfo(FILEINFO_MIME_TYPE);
394
395
        if (is_resource($content)) {
396
            return $fileInfo->file(stream_get_meta_data($content)['uri']);
397
        }
398
399
        return $fileInfo->buffer($content);
400
    }
401
}
402

src/Gaufrette/Adapter/AsyncAwsS3.php 1 location

@@ 329-338 (lines=10) @@
326
     *
327
     * @return string
328
     */
329
    private function guessContentType($content)
330
    {
331
        $fileInfo = new \finfo(FILEINFO_MIME_TYPE);
332
333
        if (is_resource($content)) {
334
            return $fileInfo->file(stream_get_meta_data($content)['uri']);
335
        }
336
337
        return $fileInfo->buffer($content);
338
    }
339
}
340