Controller   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 23
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A behaviors() 0 6 1
A beforeAction() 0 5 1
1
<?php
2
3
namespace bedezign\yii2\audit\components\web;
4
5
use bedezign\yii2\audit\components\Access;
6
use bedezign\yii2\audit\web\AuditAsset;
7
use bedezign\yii2\audit\Audit;
8
use Yii;
9
use yii\web\View;
10
11
/**
12
 * Base Controller
13
 * @package bedezign\yii2\audit\components\web
14
 *
15
 * @property Audit $module
16
 * @property View  $view
17
 */
18
class Controller extends \yii\web\Controller
19
{
20
    /**
21
     * @return array
22
     */
23 42
    public function behaviors()
24
    {
25
        return [
26 42
            'access' => Access::getAccessControlFilter()
27 42
        ];
28
    }
29
30
    /**
31
     * @param \yii\base\Action $action
32
     * @return bool
33
     */
34 42
    public function beforeAction($action)
35
    {
36 42
        AuditAsset::register($this->view);
37 42
        return parent::beforeAction($action);
38
    }
39
40
}
41