Passed
Pull Request — master (#3156)
by Sergei
13:01
created

PsrAdapter   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 88.89%

Importance

Changes 0
Metric Value
wmc 3
dl 0
loc 26
ccs 8
cts 9
cp 0.8889
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A startQuery() 0 5 1
A __construct() 0 3 1
A stopQuery() 0 2 1
1
<?php
2
3
namespace Doctrine\DBAL\Logging;
4
5
use Psr\Log\LoggerInterface;
6
7
/**
8
 * Logs every query as a debug message
9
 */
10
final class PsrAdapter implements SQLLogger
11
{
12
    /** @var LoggerInterface */
13
    private $logger;
14
15 19
    public function __construct(LoggerInterface $logger)
16
    {
17 19
        $this->logger = $logger;
18 19
    }
19
20
    /**
21
     * {@inheritDoc}
22
     */
23 19
    public function startQuery($sql, array $params = null, array $types = null)
24
    {
25 19
        $this->logger->debug($sql, [
26 19
            'params' => $params,
27 19
            'types' => $types,
28
        ]);
29 19
    }
30
31
    /**
32
     * {@inheritDoc}
33
     */
34
    public function stopQuery()
35
    {
36
    }
37
}
38