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

EntryToObjectsServiceFactory::createService()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 21
Code Lines 11

Duplication

Lines 21
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 21
loc 21
rs 9.3142
cc 2
eloc 11
nc 2
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\EntryToObjects;
7
8
use Zend\ServiceManager\AbstractPluginManager;
9
use Zend\ServiceManager\FactoryInterface;
10
use Zend\ServiceManager\ServiceLocatorInterface;
11
use OldTown\Workflow\ZF2\ServiceEngine\Workflow;
12
use OldTown\Workflow\ZF2\Toolkit\Options\ModuleOptions;
13
14
15
/**
16
 * Class EntryToObjectsServiceFactory
17
 *
18
 * @package OldTown\Workflow\ZF2\Toolkit\EntryToObjects
19
 */
20 View Code Duplication
class EntryToObjectsServiceFactory 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 EntryToObjectsService
26
     * @throws \Zend\ServiceManager\Exception\ServiceNotFoundException
27
     */
28
    public function createService(ServiceLocatorInterface $serviceLocator)
29
    {
30
        $appServiceLocator = $serviceLocator;
31
        if ($serviceLocator instanceof AbstractPluginManager) {
32
            $appServiceLocator = $serviceLocator->getServiceLocator();
33
        }
34
35
36
37
        $serializerManager = $appServiceLocator->get('SerializerAdapterManager');
38
        $moduleOptions = $appServiceLocator->get(ModuleOptions::class);
39
        $workflowService  = $appServiceLocator->get(Workflow::class);
40
41
        return new EntryToObjectsService(
42
            [
43
                'serializerManager' => $serializerManager,
44
                'moduleOptions' => $moduleOptions,
45
                'workflowService' => $workflowService
46
            ]
47
        );
48
    }
49
}
50