Completed
Push — master ( 8527b6...a1fe62 )
by Charles
02:30
created

InfoController   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 21
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A actions() 0 11 2
A behaviors() 0 6 1
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