Completed
Pull Request — master (#30)
by vincent
03:53
created

NullLoggerBuilder   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getLogger() 0 4 1
A getMainCLassName() 0 4 1
A getPackageName() 0 4 1
1
<?php declare(strict_types = 1);
2
/**
3
 * This file is part of the Tmdb package.
4
 *
5
 * (c) Vincent Faliès <[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
 * @author Vincent Faliès <[email protected]>
11
 * @copyright Copyright (c) 2017
12
 */
13
14
15
namespace VfacTmdb\Factory\Builder;
16
17
use VfacTmdb\Interfaces\Factory\LoggerBuilderInterface;
18
19
/**
20
 * Builder to implement Logger with Null object
21
 * @package Tmdb
22
 * @author Vincent Faliès <[email protected]>
23
 * @copyright Copyright (c) 2017
24
 */
25
class NullLoggerBuilder implements LoggerBuilderInterface
26
{
27
28
    /**
29
     * This method MUST return a valid PSR3 logger
30
     * @return \Psr\Log\LoggerInterface
31
     */
32 2
    public function getLogger() : \Psr\Log\LoggerInterface
33
    {
34 2
        return new \Psr\Log\NullLogger;
35
    }
36
37
    /**
38
     * This method MUST return the name of the main class
39
     * @return string
40
     */
41 1
    public function getMainCLassName() : string
42
    {
43 1
        return '\Psr\Log\NullLogger';
44
    }
45
46
    /**
47
     * This method MUST return the name of the package name
48
     * @return string
49
     */
50 1
    public function getPackageName() : string
51
    {
52 1
        return 'psr/log';
53
    }
54
}
55