DbalMiddleware   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 10
c 0
b 0
f 0
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 2 1
A wrap() 0 3 1
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