Module::init()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 7

Duplication

Lines 12
Ratio 100 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 12
loc 12
rs 9.4285
cc 2
eloc 7
nc 2
nop 0
1
<?php
2
/**
3
 * @link      http://www.writesdown.com/
4
 * @copyright Copyright (c) 2015 WritesDown
5
 * @license   http://www.writesdown.com/license/
6
 */
7
8
namespace modules\sitemap\backend;
9
10
use Yii;
11
12
/**
13
 * Class Module
14
 *
15
 * @author  Agiel K. Saputra <[email protected]>
16
 * @since   0.2.0
17
 */
18
class Module extends \yii\base\Module
19
{
20
    /**
21
     * @var string
22
     */
23
    public $controllerNamespace = 'modules\sitemap\backend\controllers';
24
25
    /**
26
     * @inheritdoc
27
     */
28 View Code Duplication
    public function init()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
29
    {
30
        parent::init();
31
32
        if (!isset(Yii::$app->i18n->translations['sitemap'])) {
33
            Yii::$app->i18n->translations['sitemap'] = [
34
                'class'          => 'yii\i18n\PhpMessageSource',
35
                'sourceLanguage' => Yii::$app->language,
36
                'basePath'       => __DIR__ . '/../messages',
37
            ];
38
        }
39
    }
40
}
41