MappingCollectorFactory   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 3
dl 0
loc 29
ccs 0
cts 13
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 7 1
A createService() 0 4 1
A getOptionsClass() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace DoctrineORMModule\Service;
6
7
use DoctrineModule\Service\AbstractFactory;
8
use DoctrineORMModule\Collector\MappingCollector;
9
use Interop\Container\ContainerInterface;
10
use Laminas\ServiceManager\ServiceLocatorInterface;
11
12
/**
13
 * Service factory responsible for instantiating {@see \DoctrineORMModule\Collector\MappingCollector}
14
 */
15
class MappingCollectorFactory extends AbstractFactory
16
{
17
    /**
18
     * {@inheritDoc}
19
     *
20
     * @return MappingCollector
21
     */
22
    public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null)
23
    {
24
        $name          = $this->getName();
25
        $objectManager = $container->get('doctrine.entitymanager.' . $name);
26
27
        return new MappingCollector($objectManager->getMetadataFactory(), 'doctrine.mapping_collector.' . $name);
28
    }
29
30
    /**
31
     * {@inheritDoc}
32
     *
33
     * @return MappingCollector
34
     */
35
    public function createService(ServiceLocatorInterface $container)
36
    {
37
        return $this($container, MappingCollector::class);
38
    }
39
40
    public function getOptionsClass() : string
41
    {
42
    }
43
}
44