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 ( 89bae3...b4e0b1 )
by Андрей
03:42
created

EntryIdResolverFactory::createService()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 21
Code Lines 11

Duplication

Lines 21
Ratio 100 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 21
loc 21
rs 9.3142
cc 1
eloc 11
nc 1
nop 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\EntryToObjects\EntryToObjectsService;
13
use OldTown\Workflow\ZF2\Toolkit\Options\ModuleOptions;
14
15
/**
16
 * Class EntryIdResolverFactory
17
 *
18
 * @package OldTown\Workflow\ZF2\Toolkit\WorkflowRunParams
19
 */
20 View Code Duplication
class EntryIdResolverFactory implements FactoryInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
21
{
22
    /**
23
     * @param ServiceLocatorInterface $serviceLocator
24
     *
25
     * @return EntryIdResolver
26
     * @throws \Zend\ServiceManager\Exception\ServiceNotFoundException
27
     * @throws \Zend\ServiceManager\Exception\ServiceNotCreatedException
28
     * @throws \Zend\ServiceManager\Exception\RuntimeException
29
     */
30
    public function createService(ServiceLocatorInterface $serviceLocator)
31
    {
32
        /** @var WorkflowServiceManager $wfServiceManager */
33
        $wfServiceManager = $serviceLocator->get(WorkflowServiceManager::class);
34
35
        /** @var EntryToObjectsService $entryToObjectsService */
36
        $entryToObjectsService = $wfServiceManager->get(EntryToObjectsService::class);
37
        $moduleOptions = $serviceLocator->get(ModuleOptions::class);
38
39
        /** @var Application $app */
40
        $app = $serviceLocator->get('Application');
41
        $mvcEvent = $app->getMvcEvent();
42
43
        $options = [
44
            'entryToObjectsService' => $entryToObjectsService,
45
            'moduleOptions'                => $moduleOptions,
46
            'mvcEvent'                   => $mvcEvent
47
        ];
48
49
        return new EntryIdResolver($options);
50
    }
51
}
52