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

AppBootstrap::bootstrap()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 10
rs 10
cc 1
nc 1
nop 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