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

ImageTypeMap   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 21
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getMap() 0 13 1
1
<?php
2
/**
3
 * ImageTypeMap.
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 image filetypes.
16
 */
17
class ImageTypeMap 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(['bmp'], 'image/bmp'),
28 9
            new Type(['gif'], 'image/gif'),
29 9
            new Type(['ico'], 'image/x-icon'),
30 9
            new Type(['jpg', 'jpeg'], 'image/jpeg'),
31 9
            new Type(['png'], 'image/png'),
32 9
            new Type(['svg'], 'image/svg+xml'),
33 9
            new Type(['tif', 'tiff'], 'image/tiff'),
34 9
            new Type(['webp'], 'image/webp'),
35 9
        ];
36
    }
37
}
38