IndexController::actionIndex()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 2
cts 2
cp 1
cc 1
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', 'Page not found'));
32 45
        }
33
34
        $this->layout = 'maintenance';
35 45
        return $this->render('maintenance');
36
    }
37
}
38