DoctrineStorageFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 11 1
1
<?php
2
3
namespace Svycka\SocialUser\Storage\Factory;
4
5
use Laminas\ServiceManager\Factory\FactoryInterface;
6
use Interop\Container\ContainerInterface;
7
use Svycka\SocialUser\Storage\Doctrine;
8
9
/**
10
 * @author Vytautas Stankus <[email protected]>
11
 * @license MIT
12
 */
13
final class DoctrineStorageFactory implements FactoryInterface
14
{
15 1
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
16
    {
17 1
        $entityManager = $container->get('doctrine.entitymanager.orm_default');
18
19 1
        $config = $container->get('config')['svycka_social_user'];
20
        $options = [
21 1
            'social_user_entity' => $config['social_user_entity'],
22
        ];
23
24 1
        return new Doctrine($entityManager, $options);
25
    }
26
}
27