DoctrineStorageFactory::__invoke()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 11
ccs 5
cts 5
cp 1
rs 9.9
c 0
b 0
f 0
cc 1
nc 1
nop 3
crap 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