GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

ModuleOptionsFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 21
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A createService() 0 10 2
1
<?php
2
/**
3
 * @link https://github.com/old-town/workflow-zf2-service
4
 * @author  Malofeykin Andrey  <[email protected]>
5
 */
6
namespace OldTown\Workflow\ZF2\Service\Options;
7
8
use Zend\ServiceManager\FactoryInterface;
9
use Zend\ServiceManager\ServiceLocatorInterface;
10
use OldTown\Workflow\ZF2\Service\Module;
11
12
/**
13
 * Class ModuleOptionsFactory
14
 *
15
 * @package OldTown\Workflow\ZF2\Service\Options
16
 */
17
class ModuleOptionsFactory implements FactoryInterface
18
{
19
    /**
20
     * Create service
21
     *
22
     * @param ServiceLocatorInterface $serviceLocator
23
     * @return ModuleOptions
24
     *
25
     * @throws \Zend\ServiceManager\Exception\ServiceNotFoundException
26
     */
27
    public function createService(ServiceLocatorInterface $serviceLocator)
28
    {
29
        /** @var array $appConfig */
30
        $appConfig = $serviceLocator->get('config');
31
        $config = [];
32
        if (array_key_exists(Module::CONFIG_KEY, $appConfig)) {
33
            $config = $appConfig[Module::CONFIG_KEY];
34
        }
35
        return new ModuleOptions($config);
36
    }
37
}
38