Code Duplication    Length = 10-10 lines in 4 locations

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/AzureBlobStorage.php 1 location

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

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

@@ 337-346 (lines=10) @@
334
     *
335
     * @return string
336
     */
337
    private function guessContentType($content)
338
    {
339
        $fileInfo = new \finfo(FILEINFO_MIME_TYPE);
340
341
        if (is_resource($content)) {
342
            return $fileInfo->file(stream_get_meta_data($content)['uri']);
343
        }
344
345
        return $fileInfo->buffer($content);
346
    }
347
}
348