Passed
Pull Request — 1.x (#78)
by Akihito
15:59 queued 13:51
created

ProfilerProvider::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Ray\AuraSqlModule;
6
7
use Aura\Sql\Profiler\Profiler;
8
use Override;
9
use Psr\Log\LoggerInterface;
10
use Ray\Di\Provider;
11
12
final readonly class ProfilerProvider implements Provider
0 ignored issues
show
Bug introduced by
A parse error occurred: Syntax error, unexpected T_READONLY, expecting T_CLASS on line 12 at column 6
Loading history...
13
{
14
    public function __construct(private LoggerInterface $logger)
15
    {
16
    }
17
18
    #[Override]
19
    public function get(): Profiler
20
    {
21
        $profiler = new Profiler($this->logger);
22
        $profiler->setLogFormat('{duration}: {function} {statement}:{values}');
23
        $profiler->setActive(true);
24
25
        return $profiler;
26
    }
27
}
28