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.

EntryToObjectsServiceFactory::createService()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 21
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
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
class EntryToObjectsServiceFactory implements FactoryInterface
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