Completed
Push — Grotax-Grotax-patch-1 ( 7ff330 )
by Alex
02:18
created

NullLoggerBuilder   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getLogger() 0 4 1
A getMainClassName() 0 4 1
A getPackageName() 0 4 1
A __construct() 0 5 1
1
<?php
2
/*
3
 * This file is part of the feed-io package.
4
 *
5
 * (c) Alexandre Debril <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace FeedIo\Factory\Builder;
12
13
use FeedIo\Factory\LoggerBuilderInterface;
14
use \Psr\Log\NullLogger;
15
16
/**
17
 * @package FeedIo
18
 */
19
class NullLoggerBuilder implements LoggerBuilderInterface
20
{
21
22
    /**
23
     * @param array $config
24
     */
25 5
    public function __construct(array $config = [])
0 ignored issues
show
Unused Code introduced by
The parameter $config is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
26
    {
27
        // Ignore config as NullLogger does not accept any config
28
        // Done for FeedIo\Factory compatibility
29 5
    }
30
31
    /**
32
     * This method MUST return a valid PSR3 logger
33
     * @return \Psr\Log\NullLogger
34
     */
35 2
    public function getLogger()
36
    {
37 2
        return new \Psr\Log\NullLogger;
38
    }
39
 
40
    /**
41
     * This method MUST return the name of the main class
42
     * @return string
43
     */
44 1
    public function getMainClassName()
45
    {
46 1
        return '\Psr\Log\NullLogger';
47
    }
48
    
49
    /**
50
     * This method MUST return the name of the package name
51
     * @return string
52
     */
53 1
    public function getPackageName()
54
    {
55 1
        return 'psr/log';
56
    }
57
}
58