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.

WorkflowServiceFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A createService() 0 13 1
1
<?php
2
/**
3
 * @link https://github.com/old-town/workflow-zf2
4
 * @author  Malofeykin Andrey  <[email protected]>
5
 */
6
namespace  OldTown\Workflow\ZF2\Factory;
7
8
use Zend\ServiceManager\FactoryInterface;
9
use Zend\ServiceManager\MutableCreationOptionsInterface;
10
use Zend\ServiceManager\MutableCreationOptionsTrait;
11
use Zend\ServiceManager\ServiceLocatorInterface;
12
use OldTown\Workflow\ZF2\ServiceEngine\Workflow;
13
use OldTown\Workflow\ZF2\Options\ModuleOptions;
14
15
16
/**
17
 * Class WorkflowServiceFactory
18
 *
19
 * @package OldTown\Workflow\ZF2\Factory
20
 *
21
 */
22
class WorkflowServiceFactory implements FactoryInterface, MutableCreationOptionsInterface
23
{
24
    use MutableCreationOptionsTrait;
25
26
    /**
27
     * @param ServiceLocatorInterface $serviceLocator
28
     *
29
     * @return Workflow
30
     *
31
     * @throws \Zend\Stdlib\Exception\InvalidArgumentException
32
     * @throws \OldTown\Workflow\ZF2\Service\Exception\InvalidArgumentException
33
     * @throws \OldTown\Workflow\ZF2\ServiceEngine\Exception\InvalidArgumentException
34
     * @throws \Zend\ServiceManager\Exception\ServiceNotFoundException
35
     */
36
    public function createService(ServiceLocatorInterface $serviceLocator)
37
    {
38
39
        /** @var ModuleOptions $moduleOptions */
40
        $moduleOptions = $serviceLocator->get(ModuleOptions::class);
41
42
        $options = [
43
            'serviceLocator' => $serviceLocator,
44
            'moduleOptions'  => $moduleOptions
45
        ];
46
47
        return new Workflow($options);
48
    }
49
}
50