RbacController   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 14
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A actionInit() 0 11 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: zmievskaya
5
 * Date: 18.11.16
6
 * Time: 10:59
7
 */
8
9
namespace app\commands;
10
11
use Yii;
12
use yii\console\Controller;
13
14
class RbacController extends Controller
15
{
16
    public function actionInit()
17
    {
18
        $auth = Yii::$app->authManager;
19
20
        $user = $auth->createRole('user');
21
        $auth->add($user);
22
23
        $admin = $auth->createRole('admin');
24
        $auth->add($admin);
25
        $auth->addChild($admin, $user);
26
    }
27
}