Passed
Push — master ( c780ff...99d842 )
by Aleksandr
02:09
created

Bootstrap   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 10
c 0
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A bootstrap() 0 6 3
1
<?php
2
3
4
namespace carono\exchange1c;
5
6
7
use carono\exchange1c\helpers\ModuleHelper;
8
use yii\base\Application;
9
use yii\base\BootstrapInterface;
10
use Yii;
11
12
class Bootstrap implements BootstrapInterface
13
{
14
15
    /**
16
     * Bootstrap method to be called during application bootstrap stage.
17
     *
18
     * @param Application $app the application currently running
19
     */
20
    public function bootstrap($app)
0 ignored issues
show
Coding Style Best Practice introduced by
Please use __construct() instead of a PHP4-style constructor that is named after the class.
Loading history...
21
    {
22
        if ($id = ModuleHelper::getModuleNameByClass()) {
23
            if (Yii::$app->getModule($id)->bootstrapUrlRule) {
24
                Yii::$app->urlManager->enablePrettyUrl = true;
25
                Yii::$app->urlManager->addRules([new UrlRule]);
26
            }
27
        }
28
    }
29
}