createService()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 7
rs 9.4285
cc 1
eloc 5
nc 1
nop 1
1
<?php
2
/**
3
 * @link    https://github.com/nnx-framework/doctrine-fixture-module
4
 * @author  Malofeykin Andrey  <[email protected]>
5
 */
6
namespace Nnx\DoctrineFixtureModule\FixtureInitializer;
7
8
use Zend\ServiceManager\FactoryInterface;
9
use Zend\ServiceManager\MutableCreationOptionsInterface;
10
use Zend\ServiceManager\MutableCreationOptionsTrait;
11
use Zend\ServiceManager\ServiceLocatorInterface;
12
13
/**
14
 * Class ObjectManagerNameInitializer
15
 *
16
 * @package Nnx\DoctrineFixtureModule\FixtureInitializer
17
 */
18
class ObjectManagerNameInitializerFactory implements FactoryInterface, MutableCreationOptionsInterface
19
{
20
    use MutableCreationOptionsTrait;
21
22
    /**
23
     * @inheritDoc
24
     */
25
    public function createService(ServiceLocatorInterface $serviceLocator)
26
    {
27
        $context = $this->getCreationOptions();
28
        $objectManagerNameInitializer = new ObjectManagerNameInitializer();
29
        $objectManagerNameInitializer->setContextData($context);
30
        return $objectManagerNameInitializer;
31
    }
32
}
33