Passed
Push — master ( 6f2986...60854d )
by Rutger
13:35
created

AppBootstrap   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 6
c 1
b 0
f 0
dl 0
loc 12
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A bootstrap() 0 10 1
1
<?php
2
3
namespace sample\components;
4
5
use rhertogh\Yii2Oauth2Server\events\base\Oauth2BaseEvent;
6
use rhertogh\Yii2Oauth2Server\Oauth2Module;
7
use Yii;
8
use yii\base\BootstrapInterface;
9
use yii\base\Event;
10
11
class AppBootstrap implements BootstrapInterface
12
{
13
    public function bootstrap($app)
14
    {
15
        /**
16
         * Sample event handling, just logging the event for now.
17
         */
18
        Event::on(
19
            Oauth2Module::class,
20
            'Oauth2Server.*',
21
            function (Oauth2BaseEvent $event) {
22
                Yii::info($event->name, 'Oauth2 Sample Event');
23
            }
24
        );
25
    }
26
27
}
28