Completed
Pull Request — master (#8)
by
unknown
15:43
created

DoctrineTransactionFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 1
c 2
b 0
f 0
lcom 0
cbo 2
dl 0
loc 18
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 7 1
1
<?php
2
namespace TacticianModule\Factory\Plugin;
3
4
use Interop\Container\ContainerInterface;
5
use League\Tactician\Doctrine\ORM\TransactionMiddleware;
6
use Zend\ServiceManager\Factory\FactoryInterface;
7
8
class DoctrineTransactionFactory implements FactoryInterface
9
{
10
    /**
11
     * Create service
12
     *
13
     * @param ContainerInterface $container
14
     * @param string $requestedName
15
     * @param array $options
16
     * @return TransactionMiddleware
17
     */
18
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
19
    {
20
        $config = $container->get('config')['tactician']['plugins'];
21
        $ormKey = $config[TransactionMiddleware::class];
22
23
        return new TransactionMiddleware($container->get($ormKey));
24
    }
25
}
26