DbConfigResourceMiddlewareFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 18
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 12 1
1
<?php
2
declare(strict_types=1);
3
4
namespace SlayerBirden\DataFlowServer\Db\Factory;
5
6
use Interop\Container\ContainerInterface;
7
use Psr\Log\LoggerInterface;
8
use SlayerBirden\DataFlowServer\Db\Entities\DbConfiguration;
9
use SlayerBirden\DataFlowServer\Doctrine\Middleware\BaseResourceMiddleware;
10
use SlayerBirden\DataFlowServer\Doctrine\Middleware\ResourceMiddlewareInterface;
11
use SlayerBirden\DataFlowServer\Doctrine\Persistence\EntityManagerRegistry;
12
use Zend\ServiceManager\Factory\FactoryInterface;
13
14
final class DbConfigResourceMiddlewareFactory implements FactoryInterface
15
{
16
    /**
17
     * @inheritdoc
18
     */
19 16
    public function __invoke(
20
        ContainerInterface $container,
21
        $requestedName,
22
        array $options = null
23
    ): ResourceMiddlewareInterface {
24 16
        return new BaseResourceMiddleware(
25 16
            $container->get(EntityManagerRegistry::class),
26 16
            $container->get(LoggerInterface::class),
27 16
            DbConfiguration::class,
28 16
            'configuration'
29
        );
30
    }
31
}
32