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.

Module::getModuleDependencies()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 9
rs 9.6666
cc 1
eloc 6
nc 1
nop 0
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;
7
8
9
use OldTown\Workflow\ZF2\Toolkit\WorkflowRunParams\EntryIdResolver;
10
use Zend\Mvc\ModuleRouteListener;
11
use Zend\Mvc\MvcEvent;
12
use Zend\EventManager\EventInterface;
13
use Zend\ModuleManager\Feature\AutoloaderProviderInterface;
14
use Zend\ModuleManager\Feature\ConfigProviderInterface;
15
use Zend\ModuleManager\Feature\BootstrapListenerInterface;
16
use Zend\ModuleManager\Feature\DependencyIndicatorInterface;
17
18
19
/**
20
 * Class Module
21
 *
22
 * @package OldTown\Workflow\ZF2\Toolkit
23
 */
24
class Module implements
25
    BootstrapListenerInterface,
26
    ConfigProviderInterface,
27
    AutoloaderProviderInterface,
28
    DependencyIndicatorInterface
29
{
30
31
    /**
32
     * Имя секции в конфиги приложения
33
     *
34
     * @var string
35
     */
36
    const CONFIG_KEY = 'workflow_zf2_toolkit';
37
38
    /**
39
     * @return array
40
     */
41
    public function getModuleDependencies()
42
    {
43
        return [
44
            'OldTown\\Workflow\\ZF2',
45
            'OldTown\\Workflow\\ZF2\\Service',
46
            'OldTown\\Workflow\\ZF2\\Dispatch',
47
            'OldTown\\Workflow\\Doctrine\\ZF2'
48
        ];
49
    }
50
51
    /**
52
     * @param EventInterface $e
53
     *
54
     * @return array|void
55
     *
56
     * @throws \Zend\ServiceManager\Exception\ServiceNotFoundException
57
     */
58
    public function onBootstrap(EventInterface $e)
59
    {
60
        /** @var MvcEvent $e */
61
        $eventManager        = $e->getApplication()->getEventManager();
62
        $moduleRouteListener = new ModuleRouteListener();
63
        $moduleRouteListener->attach($eventManager);
64
65
        $sm = $e->getApplication()->getServiceManager();
66
67
        /** @var EntryIdResolver $entryIdResolver */
68
        $entryIdResolver = $sm->get(EntryIdResolver::class);
69
        $eventManager->attach($entryIdResolver);
0 ignored issues
show
Documentation introduced by
$entryIdResolver is of type object<OldTown\Workflow\...Params\EntryIdResolver>, but the function expects a string.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
70
    }
71
72
73
    /**
74
     * @return mixed
75
     */
76
    public function getConfig()
77
    {
78
        return include __DIR__ . '/config/module.config.php';
79
    }
80
81
    /**
82
     * @return array
83
     */
84
    public function getAutoloaderConfig()
85
    {
86
        return array(
87
            'Zend\Loader\StandardAutoloader' => array(
88
                'namespaces' => array(
89
                    __NAMESPACE__ => __DIR__ . '/src/',
90
                ),
91
            ),
92
        );
93
    }
94
95
}