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::createService()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
c 3
b 0
f 0
dl 0
loc 13
rs 9.4285
cc 1
eloc 6
nc 1
nop 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