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.
Completed
Push — dev ( 4095d1...89bae3 )
by Андрей
04:02
created

EntryIdResolverFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
B createService() 0 27 1
1
<?php
2
/**
3
 * @link    https://github.com/old-town/workflow-zf2-toolkit
4
 * @author  Malofeykin Andrey  <[email protected]>
5
 */
6
namespace OldTown\Workflow\ZF2\Toolkit\WorkflowRunParams;
7
8
use Zend\Mvc\Application;
9
use Zend\ServiceManager\FactoryInterface;
10
use Zend\ServiceManager\ServiceLocatorInterface;
11
use OldTown\Workflow\ZF2\Service\Service\Manager as WorkflowServiceManager;
12
use OldTown\Workflow\ZF2\Toolkit\DoctrineWorkflowStory\DoctrineWorkflowStoryService;
13
use OldTown\Workflow\ZF2\Toolkit\Options\ModuleOptions;
14
use OldTown\Workflow\ZF2\ServiceEngine\Workflow as WorkflowService;
15
16
/**
17
 * Class EntryIdResolverFactory
18
 *
19
 * @package OldTown\Workflow\ZF2\Toolkit\WorkflowRunParams
20
 */
21
class EntryIdResolverFactory implements FactoryInterface
22
{
23
    /**
24
     * @param ServiceLocatorInterface $serviceLocator
25
     *
26
     * @return EntryIdResolver
27
     * @throws \Zend\ServiceManager\Exception\ServiceNotFoundException
28
     * @throws \Zend\ServiceManager\Exception\ServiceNotCreatedException
29
     * @throws \Zend\ServiceManager\Exception\RuntimeException
30
     */
31
    public function createService(ServiceLocatorInterface $serviceLocator)
32
    {
33
        /** @var WorkflowServiceManager $wfServiceManager */
34
        $wfServiceManager = $serviceLocator->get(WorkflowServiceManager::class);
35
36
        /** @var DoctrineWorkflowStoryService $doctrineWorkflowStoryService */
37
        $doctrineWorkflowStoryService = $wfServiceManager->get(DoctrineWorkflowStoryService::class);
38
        $moduleOptions = $serviceLocator->get(ModuleOptions::class);
39
40
        $workflowService = $serviceLocator->get(WorkflowService::class);
41
42
        /** @var Application $app */
43
        $app = $serviceLocator->get('Application');
44
        $mvcEvent = $app->getMvcEvent();
45
46
        $serializer = $doctrineWorkflowStoryService->getSerializer();
47
48
        $options = [
49
            'doctrineWorkflowStoryService' => $doctrineWorkflowStoryService,
50
            'moduleOptions'                => $moduleOptions,
51
            'workflowService'              => $workflowService,
52
            'mvcEvent'                   => $mvcEvent,
53
            'serializer'                   => $serializer
54
        ];
55
56
        return new EntryIdResolver($options);
57
    }
58
}
59