Completed
Push — master ( 693b45...fe0562 )
by Westin
01:39
created

ProcessorMapper   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A map() 0 11 2
1
<?php
2
declare(strict_types=1);
3
4
namespace WShafer\PSR11MonoLog\Processor;
5
6
use Monolog\Processor\PsrLogMessageProcessor;
7
use WShafer\PSR11MonoLog\MapperInterface;
8
9
/**
10
 * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
11
 */
12
class ProcessorMapper implements MapperInterface
13
{
14
    /**
15
     * @param string $type
16
     * @return null|string
17
     *
18
     * @SuppressWarnings(PHPMD.CyclomaticComplexity)
19
     */
20 2
    public function map(string $type)
21
    {
22 2
        $type = strtolower($type);
23
24
        switch ($type) {
25 2
            case 'psrlogmessage':
26 1
                return PsrLogMessageProcessorFactory::class;
27
        }
28
29 1
        return null;
30
    }
31
}
32