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

ProcessorMapper::map()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 11
ccs 5
cts 5
cp 1
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 6
nc 2
nop 1
crap 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