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.
Passed
Branch dev (d5e133)
by Андрей
20:27 queued 13s
created

Module   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 67
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5
Metric Value
wmc 4
lcom 0
cbo 5
dl 0
loc 67
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getModuleDependencies() 0 6 1
A onBootstrap() 0 11 1
A getConfig() 0 4 1
A getAutoloaderConfig() 0 10 1
1
<?php
2
/**
3
 * @link https://github.com/old-town/workflow-zf2-dispatch
4
 * @author  Malofeykin Andrey  <[email protected]>
5
 */
6
namespace OldTown\Workflow\ZF2\Dispatch;
7
8
9
use Zend\Mvc\ModuleRouteListener;
10
use Zend\Mvc\MvcEvent;
11
use Zend\EventManager\EventInterface;
12
use Zend\ModuleManager\Feature\AutoloaderProviderInterface;
13
use Zend\ModuleManager\Feature\ConfigProviderInterface;
14
use Zend\ModuleManager\Feature\BootstrapListenerInterface;
15
use Zend\ModuleManager\Feature\DependencyIndicatorInterface;
16
use OldTown\Workflow\ZF2\Dispatch\Listener\WorkflowDispatchListener;
17
18
19
/**
20
 * Class Module
21
 *
22
 * @package OldTown\Workflow\ZF2
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_dispatch';
37
38
    /**
39
     * @return array
40
     */
41
    public function getModuleDependencies()
42
    {
43
        return [
44
            'OldTown\\Workflow\\ZF2'
45
        ];
46
    }
47
48
    /**
49
     * @param EventInterface $e
50
     *
51
     * @return array|void
52
     *
53
     * @throws \Zend\ServiceManager\Exception\ServiceNotFoundException
54
     */
55
    public function onBootstrap(EventInterface $e)
56
    {
57
        /** @var MvcEvent $e */
58
        $eventManager        = $e->getApplication()->getEventManager();
59
        $moduleRouteListener = new ModuleRouteListener();
60
        $moduleRouteListener->attach($eventManager);
61
62
        /** @var WorkflowDispatchListener $injectWorkflowListener */
63
        $injectWorkflowListener = $e->getApplication()->getServiceManager()->get(WorkflowDispatchListener::class);
64
        $eventManager->attach($injectWorkflowListener);
0 ignored issues
show
Documentation introduced by
$injectWorkflowListener is of type object<OldTown\Workflow\...rkflowDispatchListener>, 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...
65
    }
66
67
68
    /**
69
     * @return mixed
70
     */
71
    public function getConfig()
72
    {
73
        return include __DIR__ . '/config/module.config.php';
74
    }
75
76
    /**
77
     * @return array
78
     */
79
    public function getAutoloaderConfig()
80
    {
81
        return array(
82
            'Zend\Loader\StandardAutoloader' => array(
83
                'namespaces' => array(
84
                    __NAMESPACE__ => __DIR__ . '/src/',
85
                ),
86
            ),
87
        );
88
    }
89
90
}