ClassLoaderFactory::createService()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 8
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 8
loc 8
rs 9.4285
cc 2
eloc 4
nc 2
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\Loader;
7
8
use Zend\ServiceManager\FactoryInterface;
9
use Zend\ServiceManager\MutableCreationOptionsInterface;
10
use Zend\ServiceManager\MutableCreationOptionsTrait;
11
use Zend\ServiceManager\ServiceLocatorInterface;
12
use Doctrine\Fixture\Loader\ClassLoader;
13
14
/**
15
 * Class ClassLoaderFactory
16
 *
17
 * @package Nnx\DoctrineFixtureModule\Loader
18
 */
19 View Code Duplication
class ClassLoaderFactory
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
20
    implements FactoryInterface,
0 ignored issues
show
Coding Style introduced by
The implements keyword must be on the same line as the class name
Loading history...
Coding Style introduced by
The first item in a multi-line implements list must be on the line following the implements keyword
Loading history...
21
    MutableCreationOptionsInterface
22
{
23
    use MutableCreationOptionsTrait;
24
25
    /**
26
     * @param ServiceLocatorInterface $serviceLocator
27
     *
28
     * @return ClassLoader
29
     */
30
    public function createService(ServiceLocatorInterface $serviceLocator)
31
    {
32
        $creationOptions = $this->getCreationOptions();
33
34
        $classList = array_key_exists('classList', $creationOptions) ? $creationOptions['classList'] : [];
35
36
        return new ClassLoader($classList);
37
    }
38
}
39