Completed
Pull Request — master (#8)
by Alessandro
02:36
created

NullLogger   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

6 Methods

Rating   Name   Duplication   Size   Complexity  
A logQuery() 0 3 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 1
    public function logQuery(LogEvent $event)
18
    {
19 1
    }
20
21
    /**
22
     * @return LogEvent
23
     */
24 1
    public function getLoggedEvent(): LogEvent
25
    {
26 1
        throw new \LogicException('No logged events from null logger!');
27
    }
28
29
    /**
30
     * @return bool
31
     */
32 2
    public function hasLoggedEvents(): bool
33
    {
34 2
        return false;
35
    }
36
37
    /**
38
     * @param string $connection
39
     */
40 1
    public function addConnection(string $connection)
41
    {
42 1
    }
43
44
    /**
45
     * @return array|\string[]
46
     */
47 2
    public function getConnections(): array
48
    {
49 2
        return [];
50
    }
51
52 1
    public function startLogging(LogEvent $event)
53
    {
54 1
    }
55
}
56