Completed
Pull Request — 1.x (#4)
by Yuu
26:18
created

SqlLoggerProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 27
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A get() 0 4 1
1
<?php
2
/**
3
 * This file is part of the Ray.DoctrineOrmModule package
4
 *
5
 * @license http://opensource.org/licenses/MIT MIT
6
 */
7
namespace Ray\DoctrineOrmModule;
8
9
use Doctrine\DBAL\Logging\SQLLogger;
10
use Psr\Log\LoggerInterface;
11
use Ray\Di\Di\Inject;
12
use Ray\Di\ProviderInterface;
13
use Ray\DoctrineOrmModule\Logger\PsrSqlLogger;
14
15
class SqlLoggerProvider implements ProviderInterface
16
{
17
    /**
18
     * @var LoggerInterface
19
     */
20
    private $logger;
21
22
    /**
23
     * Constructor.
24
     *
25
     * @param LoggerInterface $logger
26
     *
27
     * @Inject
28
     */
29
    public function __construct(LoggerInterface $logger)
30
    {
31
        $this->logger = $logger;
32
    }
33
34
    /**
35
     * @return SQLLogger
36
     */
37
    public function get()
38
    {
39
        return new PsrSqlLogger($this->logger);
40
    }
41
}
42