ExtractorFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 18
wmc 1
lcom 0
cbo 1
ccs 5
cts 5
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A createService() 0 9 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