InfoController::behaviors()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace api\controllers\v1;
4
5
use api\actions\VersionAction;
6
use api\actions\AppleAppSiteAssociationAction;
7
use api\actions\PostmanAuthAction;
8
use yrc\rest\Controller;
9
use yrc\web\Response;
10
use yii\web\HttpException;
11
use Yii;
12
13
class InfoController extends Controller
14
{
15
    public function actions()
16
    {
17
        $actions = [
18
            'version' => VersionAction::class,
19
        ];
20
21
        if (YII_DEBUG) {
22
            $actions['postman-auth'] = PostmanAuthAction::class;
23
        }
24
        return $actions;
25
    }
26
27
    public function behaviors()
28
    {
29
        $behaviors = parent::behaviors();
30
        $behaviors['contentNegotiator']['formats']['text/html'] = Response::FORMAT_JSON;
31
        return $behaviors;
32
    }
33
}
34