Completed
Push — dev ( 867b7a...526cfa )
by Андрей
02:26
created

EntityMapBuilderFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A createService() 0 13 1
1
<?php
2
/**
3
 * @link    https://github.com/nnx-framework/doctrine
4
 * @author  Malofeykin Andrey  <[email protected]>
5
 */
6
namespace Nnx\Doctrine\Utils;
7
8
use Zend\ServiceManager\FactoryInterface;
9
use Zend\ServiceManager\ServiceLocatorInterface;
10
use Nnx\Doctrine\ObjectManager\DoctrineObjectManagerInterface;
11
use Nnx\ModuleOptions\ModuleOptionsPluginManagerInterface;
12
use Nnx\Doctrine\EntityManager\EntityManagerInterface;
13
14
/**
15
 * Class EntityMapBuilderFactory
16
 *
17
 * @package Nnx\Doctrine\Utils
18
 */
19
class EntityMapBuilderFactory implements FactoryInterface
20
{
21
    /**
22
     * @param ServiceLocatorInterface $serviceLocator
23
     *
24
     * @return EntityMapBuilder
25
     *
26
     * @throws \Zend\ServiceManager\Exception\ServiceNotFoundException
27
     */
28
    public function createService(ServiceLocatorInterface $serviceLocator)
29
    {
30
        /** @var DoctrineObjectManagerInterface $doctrineObjectManager */
31
        $doctrineObjectManager = $serviceLocator->get(DoctrineObjectManagerInterface::class);
32
33
        /** @var ModuleOptionsPluginManagerInterface $moduleOptionsPluginManager */
34
        $moduleOptionsPluginManager = $serviceLocator->get(ModuleOptionsPluginManagerInterface::class);
35
36
        /** @var EntityManagerInterface $entityManager */
37
        $entityManager = $serviceLocator->get(EntityManagerInterface::class);
38
39
        return new EntityMapBuilder($doctrineObjectManager, $moduleOptionsPluginManager, $entityManager);
40
    }
41
}
42