FormatterMapper   A
last analyzed

Complexity

Total Complexity 15

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
C map() 0 35 15
1
<?php
2
3
declare(strict_types=1);
4
5
namespace WShafer\PSR11MonoLog\Formatter;
6
7
use WShafer\PSR11MonoLog\MapperInterface;
8
9
/**
10
 * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
11
 */
12
class FormatterMapper implements MapperInterface
13
{
14
    /**
15
     * @SuppressWarnings(PHPMD.CyclomaticComplexity)
16
     */
17 15
    public function map(string $type)
18
    {
19 15
        switch ($type) {
20 15
            case 'line':
21 1
                return LineFormatterFactory::class;
22 14
            case 'html':
23 1
                return HtmlFormatterFactory::class;
24 13
            case 'normalizer':
25 1
                return NormalizerFormatterFactory::class;
26 12
            case 'scalar':
27 1
                return ScalarFormatterFactory::class;
28 11
            case 'json':
29 1
                return JsonFormatterFactory::class;
30 10
            case 'wildfire':
31 1
                return WildfireFormatterFactory::class;
32 9
            case 'chromePHP':
33 1
                return ChromePHPFormatterFactory::class;
34 8
            case 'gelf':
35 1
                return GelfMessageFormatterFactory::class;
36 7
            case 'logstash':
37 1
                return LogstashFormatterFactory::class;
38 6
            case 'elastica':
39 1
                return ElasticaFormatterFactory::class;
40 5
            case 'loggly':
41 1
                return LogglyFormatterFactory::class;
42 4
            case 'flowdock':
43 1
                return FlowdockFormatterFactory::class;
44 3
            case 'mongodb':
45 1
                return MongoDBFormatterFactory::class;
46 2
            case 'logmatic':
47 1
                return LogmaticFormatterFactory::class;
48
        }
49
50 1
        return null;
51
    }
52
}
53