Passed
Pull Request — master (#3156)
by Sergei
12:45
created

PsrAdapter::startQuery()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

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