Completed
Push — master ( 6ea9b4...222850 )
by Andreas
04:32
created

DocumentTypeMap::getMap()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 9

Duplication

Lines 12
Ratio 100 %

Code Coverage

Tests 9
CRAP Score 1

Importance

Changes 0
Metric Value
dl 12
loc 12
ccs 9
cts 9
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 9
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * DocumentTypeMap.
4
 *
5
 * @copyright 2018 Institute of Legal Medicine, Medical University of Innsbruck
6
 * @author Andreas Erhard <[email protected]>
7
 * @license LGPL-3.0-only
8
 * @link http://www.gerichtsmedizin.at/
9
 *
10
 * @package fileinfo
11
 */
12
namespace Gmi\Toolkit\Fileinfo\Type;
13
14
/**
15
 * Type mapping provider for general document filetypes.
16
 */
17 View Code Duplication
class DocumentTypeMap implements TypeMapInterface
1 ignored issue
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
18
{
19
    /**
20
     * {@inheritdoc}
21
     *
22
     * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Complete_list_of_MIME_types
23
     * @see https://tools.ietf.org/html/rfc7763
24
     * @see https://www.iana.org/assignments/media-types/application/pdf
25
     * @see http://docutils.sourceforge.net/FAQ.html
26
     * @see https://www.thoughtco.com/mime-types-by-content-type-3469108
27
     */
28 9
    public function getMap()
29
    {
30
        return [
31 9
            new Type(['md'], 'text/markdown'),
32 9
            new Type(['pdf'], 'application/pdf'),
33 9
            new Type(['ps', 'eps'], 'application/postscript'),
34 9
            new Type(['rst'], 'text/x-rst'),
35 9
            new Type(['rtf'], 'application/rtf'),
36 9
            new Type(['tex'], 'text/x-tex'),
37 9
            new Type(['txt'], 'text/plain'),
38 9
        ];
39
    }
40
}
41