EntityManagerFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
eloc 5
dl 0
loc 13
rs 10
c 0
b 0
f 0
ccs 5
cts 5
cp 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Application\ORM;
6
7
use Doctrine\ORM\EntityManager;
8
use Ecodev\Felix\ORM\Query\Filter\AclFilter;
9
use Psr\Container\ContainerInterface;
10
11
class EntityManagerFactory
12
{
13
    /**
14
     * Return the preferred driver available on this system.
15
     */
16 2
    public function __invoke(ContainerInterface $container): EntityManager
17
    {
18 2
        $factory = new \Roave\PsrContainerDoctrine\EntityManagerFactory();
19 2
        $entityManger = $factory($container);
20
21 2
        $entityManger->getFilters()->enable(AclFilter::class);
22
23 2
        return $entityManger;
24
    }
25
}
26