ModuleOptions   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 6 2
A createService() 0 4 1
1
<?php
2
3
namespace LmcUser\Factory\Options;
4
5
use Interop\Container\ContainerInterface;
6
use Laminas\ServiceManager\Factory\FactoryInterface;
7
use Laminas\ServiceManager\ServiceLocatorInterface;
8
use LmcUser\Options;
9
10
class ModuleOptions implements FactoryInterface
11
{
12
    public function __invoke(ContainerInterface $serviceLocator, $requestedName, array $options = null)
13
    {
14
        $config = $serviceLocator->get('Config');
15
16
        return new Options\ModuleOptions(isset($config['lmcuser']) ? $config['lmcuser'] : array());
17
    }
18
19
    /**
20
     * Create service
21
     *
22
     * @param  ServiceLocatorInterface $serviceLocator
23
     * @return mixed
24
     */
25
    public function createService(ServiceLocatorInterface $serviceLocator)
26
    {
27
        return $this->__invoke($serviceLocator, null);
28
    }
29
}
30