Failed Conditions
Pull Request — master (#3156)
by Sergei
13:25
created

PsrAdapter   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
dl 0
loc 26
ccs 0
cts 13
cp 0
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
    public function __construct(LoggerInterface $logger)
16
    {
17
        $this->logger = $logger;
18
    }
19
20
    /**
21
     * {@inheritDoc}
22
     */
23
    public function startQuery($sql, array $params = null, array $types = null)
24
    {
25
        $this->logger->debug($sql, [
26
            'params' => $params,
27
            'types' => $types,
28
        ]);
29
    }
30
31
    /**
32
     * {@inheritDoc}
33
     */
34
    public function stopQuery()
35
    {
36
    }
37
}
38