Auth   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 4
c 0
b 0
f 0
lcom 1
cbo 3
dl 0
loc 24
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A bootstrap() 0 16 4
1
<?php
2
3
namespace yiicod\auth;
4
5
use Yii;
6
use yii\base\BootstrapInterface;
7
use yii\base\Component;
8
use yii\helpers\ArrayHelper;
9
10
class Auth extends Component implements BootstrapInterface
11
{
12
    /**
13
     * @var array Models settings
14
     */
15
    public $modelMap = [];
16
17
    public function bootstrap($qpp)
18
    {
19
        //Merge main extension config with local extension config
20
        $config = include(dirname(__FILE__) . '/config/main.php');
21
        foreach ($config as $key => $value) {
22
            if (is_array($value)) {
23
                $this->{$key} = ArrayHelper::merge($value, $this->{$key});
24
            } elseif (null === $this->{$key}) {
25
                $this->{$key} = $value;
26
            }
27
        }
28
29
        Yii::setAlias('@yiicod', realpath(dirname(__FILE__) . '/..'));
30
        // Namespace for migration
31
        Yii::setAlias('@yiicod_auth_migrations', realpath(dirname(__FILE__) . '/migrations'));
32
    }
33
}
34