Completed
Push — 1.x ( f905e8...4312fb )
by Akihito
25s queued 10s
created

ProfilerProvider::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Ray\AuraSqlModule;
6
7
use Aura\Sql\Profiler\Profiler;
8
use Psr\Log\LoggerInterface;
9
use Ray\Di\Provider;
10
11
class ProfilerProvider implements Provider
12
{
13
    /** @var LoggerInterface */
14
    private $logger;
15
16
    public function __construct(LoggerInterface $logger)
17
    {
18
        $this->logger = $logger;
19
    }
20
21
    public function get(): Profiler
22
    {
23
        $profiler = new Profiler($this->logger);
24
        $profiler->setLogFormat('{duration}: {function} {statement}:{values}');
25
        $profiler->setActive(true);
26
27
        return $profiler;
28
    }
29
}
30