ModuleOptionsFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 0
cbo 2
dl 0
loc 15
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A createService() 0 8 2
1
<?php
2
3
namespace JhFlexiTime\Options\Factory;
4
5
use JhFlexiTime\Options\ModuleOptions;
6
use Zend\ServiceManager\FactoryInterface;
7
use Zend\ServiceManager\ServiceLocatorInterface;
8
9
/**
10
 * Class ModuleOptionsFactory
11
 * @package JhFlexiTime\Options\Factory
12
 * @author Aydin Hassan <[email protected]>
13
 */
14
class ModuleOptionsFactory implements FactoryInterface
15
{
16
    /**
17
     * @param ServiceLocatorInterface $serviceLocator
18
     * @return ModuleOptions
19
     */
20
    public function createService(ServiceLocatorInterface $serviceLocator)
21
    {
22
        $config = $serviceLocator->get('Config');
23
24
        return new ModuleOptions(
25
            isset($config['flexi']['policy_options']) ? $config['flexi']['policy_options'] : []
26
        );
27
    }
28
}
29