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   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 32
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A createService() 21 21 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

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