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

NullLoggerBuilder::getLogger()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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