ExtractorFactory::createService()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 9
ccs 5
cts 5
cp 1
rs 9.6666
cc 1
eloc 5
nc 1
nop 1
crap 1
1
<?php
2
namespace mxdiModule\Factory\Service;
3
4
use mxdiModule\Service\ExtractorInterface;
5
use Zend\ServiceManager\FactoryInterface;
6
use Zend\ServiceManager\ServiceLocatorInterface;
7
8
class ExtractorFactory implements FactoryInterface
9
{
10
    /**
11
     * Create service
12
     *
13
     * @param ServiceLocatorInterface $serviceLocator
14
     * @return ExtractorInterface
15
     */
16 1
    public function createService(ServiceLocatorInterface $serviceLocator)
17
    {
18 1
        $config  = $serviceLocator->get('config')['mxdimodule'];
19
20 1
        $fqcn    = $config['extractor'];
21 1
        $options = $config['extractor_options'];
22
23 1
        return new $fqcn($options);
24
    }
25
}
26