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

ArchiveTypeMap::getMap()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 10
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 13
ccs 10
cts 10
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 10
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * ArchiveTypeMap.
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 archive filetypes.
16
 */
17
class ArchiveTypeMap implements TypeMapInterface
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
     */
24 9
    public function getMap()
25
    {
26
        return [
27 9
            new Type(['7z'], 'application/x-7z-compressed'),
28 9
            new Type(['bz'], 'application/x-bzip'),
29 9
            new Type(['bz2'], 'application/x-bzip2'),
30 9
            new Type(['gz'], 'application/gzip'),
31 9
            new Type(['jar'], 'application/java-archive'),
32 9
            new Type(['rar'], 'application/x-rar-compressed'),
33 9
            new Type(['tar'], 'application/x-tar'),
34 9
            new Type(['zip'], 'application/zip'),
35 9
        ];
36
    }
37
}
38