Module   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 8
c 2
b 0
f 0
dl 0
loc 31
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A init() 0 6 2
1
<?php
2
3
namespace yii2mod\comments;
4
5
use Yii;
6
7
/**
8
 * Class Module
9
 *
10
 * @package yii2mod\comments
11
 */
12
class Module extends \yii\base\Module
13
{
14
    /**
15
     * @var string the class name of the [[identity]] object
16
     */
17
    public $userIdentityClass;
18
19
    /**
20
     * @var string the class name of the comment model object, by default its yii2mod\comments\models\CommentModel
21
     */
22
    public $commentModelClass = 'yii2mod\comments\models\CommentModel';
23
24
    /**
25
     * @var string the namespace that controller classes are in
26
     */
27
    public $controllerNamespace = 'yii2mod\comments\controllers';
28
29
    /**
30
     * @var bool when admin can edit comments on frontend
31
     */
32
    public $enableInlineEdit = false;
33
34
    /**
35
     * {@inheritdoc}
36
     */
37
    public function init()
38
    {
39
        parent::init();
40
41
        if (null === $this->userIdentityClass) {
42
            $this->userIdentityClass = Yii::$app->getUser()->identityClass;
43
        }
44
    }
45
}
46