DbalMiddleware::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 0
nc 1
nop 1
dl 0
loc 2
c 0
b 0
f 0
cc 1
rs 10
1
<?php
2
3
/**
4
 * This file is part of orm
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
declare(strict_types=1);
11
12
namespace Slick\Orm\Infrastructure\Logging;
13
14
use Doctrine\DBAL\Driver as DriverInterface;
15
use Doctrine\DBAL\Driver\Middleware as MiddlewareInterface;
16
use Psr\Log\LoggerInterface;
17
18
/**
19
 * DbalMiddleware
20
 *
21
 * @package Slick\Orm\Infrastructure\Logging
22
 */
23
final class DbalMiddleware implements MiddlewareInterface
24
{
25
26
    public function __construct(private readonly LoggerInterface $logger)
27
    {
28
    }
29
30
    public function wrap(DriverInterface $driver): DriverInterface
31
    {
32
        return new DbalDriver($driver, $this->logger);
33
    }
34
}
35