MappingCollectorFactory::getOptionsClass()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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