Failed Conditions
Push — master ( 5f5e96...daf37e )
by Adrien
03:02
created

MiddlewareFactory::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
dl 0
loc 5
rs 10
c 1
b 0
f 0
ccs 0
cts 3
cp 0
cc 1
nc 1
nop 3
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Ecodev\Felix\DBAL\Logging;
6
7
use Ecodev\Felix\Log\Handler\DbHandler;
8
use Laminas\ServiceManager\Factory\FactoryInterface;
9
use Psr\Container\ContainerInterface;
10
11
class MiddlewareFactory implements FactoryInterface
12
{
13
    /**
14
     * @param string $requestedName
15
     */
16
    public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null): Middleware
17
    {
18
        $dbHandler = $container->get(DbHandler::class);
19
20
        return new Middleware($dbHandler);
21
    }
22
}
23