Completed
Push — master ( 178a08...5c0b6f )
by Oleg
05:22
created

DbConfigResourceMiddlewareFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
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 15
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

1 Method

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