Completed
Push — master ( 9c0add...0456c5 )
by Oleg
11:12
created

UserRepositoryFactory   A

Complexity

Total Complexity 1

Size/Duplication

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 7 1
1
<?php
2
declare(strict_types=1);
3
4
namespace SlayerBirden\DataFlowServer\Domain\Factory;
5
6
use Interop\Container\ContainerInterface;
7
use SlayerBirden\DataFlowServer\Doctrine\Persistence\EntityManagerRegistry;
8
use SlayerBirden\DataFlowServer\Domain\Entities\User;
9
use Zend\ServiceManager\Factory\FactoryInterface;
10
11
final class UserRepositoryFactory implements FactoryInterface
12
{
13
    /**
14
     * @inheritdoc
15
     */
16 56
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
17
    {
18
        /** @var EntityManagerRegistry $manager */
19 56
        $manager = $container->get(EntityManagerRegistry::class);
20
21 56
        return $manager->getRepository(User::class);
22
    }
23
}
24