Completed
Push — master ( 89be15...80fd60 )
by Igor
11:15
created

IndexController::behaviors()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 42
Code Lines 28

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 42
ccs 2
cts 2
cp 1
rs 8.8571
cc 1
eloc 28
nc 1
nop 0
crap 1
1
<?php
2
3
namespace app\controllers;
4
5
use Yii;
6
use yii\web\NotFoundHttpException;
7
8
class IndexController extends \yii\web\Controller
9
{
10
    /**
11
     * @inheritdoc
12
     */
13
    public function actions()
14
    {
15
        return [
16
            'error' => [
17
                'class' => 'yii\web\ErrorAction',
18
            ],
19
        ];
20
    }
21
22 45
    public function actionIndex()
23
    {
24 45
        return $this->render('index');
25
    }
26 45
27 45
    /** @see commands/MaintenanceController **/
28
    public function actionMaintenance()
29
    {
30
        if (!Yii::$app->catchAll) {
31
            throw new NotFoundHttpException(Yii::t('app.msg', 'Page not found'));
32 45
        }
33
34
        $this->layout = 'maintenance';
35 45
        return $this->render('maintenance');
36
    }
37
}
38