Passed
Push — master ( de9f16...6836c0 )
by Aleksandr
02:35
created

Bootstrap::bootstrap()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
eloc 3
nc 3
nop 1
dl 0
loc 5
rs 9.4285
c 1
b 0
f 0
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
11
class Bootstrap implements BootstrapInterface
12
{
13
14
    /**
15
     * Bootstrap method to be called during application bootstrap stage.
16
     *
17
     * @param Application $app the application currently running
18
     */
19
    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...
20
    {
21
        if ($id = ModuleHelper::getModuleNameByClass()) {
22
            if (\Yii::$app->getModule($id)->bootstrapUrlRule) {
23
                \Yii::$app->urlManager->addRules([new UrlRule]);
24
            }
25
        }
26
    }
27
}