Completed
Pull Request — master (#8)
by Alessandro
03:23
created

NullLogger   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 6
c 0
b 0
f 0
lcom 0
cbo 0
dl 0
loc 45
ccs 0
cts 22
cp 0
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A logQuery() 0 4 1
A getLoggedEvent() 0 4 1
A hasLoggedEvents() 0 4 1
A addConnection() 0 3 1
A getConnections() 0 4 1
A startLogging() 0 3 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Facile\MongoDbBundle\Services\Loggers;
6
7
use Facile\MongoDbBundle\Services\Loggers\Model\LogEvent;
8
9
/**
10
 * Class NullLogger
11
 */
12
class NullLogger implements DataCollectorLoggerInterface
13
{
14
    /**
15
     * @param LogEvent $event
16
     */
17
    public function logQuery(LogEvent $event)
18
    {
19
        return;
20
    }
21
22
    /**
23
     * @return LogEvent
24
     */
25
    public function getLoggedEvent(): LogEvent
26
    {
27
        throw new \LogicException('No logged events from null logger!');
28
    }
29
30
    /**
31
     * @return bool
32
     */
33
    public function hasLoggedEvents(): bool
34
    {
35
        return false;
36
    }
37
38
    /**
39
     * @param string $connection
40
     */
41
    public function addConnection(string $connection)
42
    {
43
    }
44
45
    /**
46
     * @return array|\string[]
47
     */
48
    public function getConnections(): array
49
    {
50
        return [];
51
    }
52
53
    public function startLogging()
54
    {
55
    }
56
}
57