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
Push — feature/EventModule ( 84f087 )
by Alexander
10:21
created

EventModule   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
B bootstrap() 0 10 6
1
<?php
2
3
namespace app\modules\event;
4
5
6
use app\components\BaseModule;
7
use app\modules\event\interfaces\EventInterface;
8
use yii\base\Application;
9
use yii\base\BootstrapInterface;
10
11
12
/**
13
 * Class EventModule
14
 * @package app\modules\event
15
 *
16
 * This module provide ability to attach custom handlers to any existing event from any module, even if module itself
17
 * will not be bootstrapped
18
 */
19
class EventModule extends BaseModule implements BootstrapInterface
20
{
21
    /**
22
     * Bootstrap method to be called during application bootstrap stage.
23
     * @param Application $app the application currently running
24
     */
25
    public function bootstrap($app)
26
    {
27
        foreach ($app->modules as $module) {
28
            if (is_object($module) && $module instanceof EventInterface) {
29
                $module->attachEventsHandlers();
30
            } elseif (is_array($module) && in_array(EventInterface::class, class_implements($module['class']), false)) {
31
                $module['class']::attachEventsHandlers();
32
            }
33
        }
34
    }
35
}